Options
These globals are now defined:
double duration; // The requested duration of the animation. double frame; // A value in [0, 1] of where we are in the animation.
This global is now defined:
GrBackendRenderTarget backEndRenderTarget;
GrBackendTexture backEndTextureRenderTarget;
Optional source image
These globals are now defined:
SkBitmap source; sk_sp<SkImage> image; GrBackendTexture backEndTexture; // GPU Only.
Note:
Adding comments with SK_FOLD_START and SK_FOLD_END creates foldable code
blocks.
These blocks will be folded by default and are useful for highlighting specific lines of code.
You can also use the keyboard shortcuts Ctrl+S and Ctrl+E in the code editor to set them.
These blocks will be folded by default and are useful for highlighting specific lines of code.
You can also use the keyboard shortcuts Ctrl+S and Ctrl+E in the code editor to set them.
xxxxxxxxxx
27
void draw(SkCanvas* canvas) {
SkPaint paint;
canvas->clear(SkColorSetARGB(0xFF, 0xFF, 0xFF, 0xFF));
canvas->scale(256.0f / 3900, 256.0f / 3900);
paint.setColor(SkColorSetARGB(0xFF, 0xB2, 0x22, 0x34));
for (int s = 0; s < 13; s += 2) {
canvas->drawIRect({0, s * 300, 7410, (s + 1) * 300}, paint);
}
paint.setColor(SkColorSetARGB(0xFF, 0x3C, 0x3B, 0x6E));
canvas->drawIRect({0, 0, 2964, 2100}, paint);
paint.setColor(SkColorSetARGB(0xFF, 0xFF, 0xFF, 0xFF));
paint.setAntiAlias(true);
SkPath star;
SkParsePath::FromSVGString(
"M 0 -120 L 70.5342 97.0819 L -114.127 -37.082 L 114.127 -37.0821 L -70.5342 "
"97.0819 Z",
&star);
for (int x = 1; x < 12; ++x) {
for (int y = 1; y < 10; ++y) {
if ((x + y) % 2 == 0) {
SkAutoCanvasRestore autoCanvasRestore(canvas, true);
canvas->translate(x * 247, y * 210);
canvas->drawPath(star, paint);
}
}
}
}