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
33
void draw(SkCanvas* canvas) {
canvas->clear(SK_ColorTRANSPARENT);
SkPath path;
auto corner_tl = SkRect::MakeXYWH(0, 0, 128, 128);
path.arcTo(corner_tl, -180, 90, true);
path.lineTo(300-16, 0);
auto corner_tr = SkRect::MakeXYWH(300-32, 0, 32, 32);
path.arcTo(corner_tr, -90, 90, false);
path.lineTo(300, 100-48);
auto corner_br = SkRect::MakeXYWH(300-96, 100-96, 96, 96);
path.arcTo(corner_br, 0, 90, false);
path.lineTo(8, 100);
auto corner_bl = SkRect::MakeXYWH(0, 100-16, 16, 16);
path.arcTo(corner_bl, 90, 90, false);
path.lineTo(0, 64);
path.close();
SkPaint paint;
paint.setAntiAlias(true);
paint.setColor(SK_ColorWHITE);
paint.setStyle(SkPaint::kFill_Style);
canvas->drawPath(path, paint);
}