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
19
void draw(SkCanvas* canvas) {
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style);
SkPoint conicPts[] = {{20, 150}, {120, 10}, {220, 150}};
canvas->drawLine(conicPts[0], conicPts[1], paint);
canvas->drawLine(conicPts[1], conicPts[2], paint);
SkColor colors[] = { 0xff88ff00, 0xff0088bb, 0xff6600cc, 0xffbb3377 };
paint.setStrokeWidth(3);
SkScalar weight = 0.5f;
for (unsigned i = 0; i < std::size(colors); ++i) {
SkPath path;
path.moveTo(conicPts[0]);
path.conicTo(conicPts[1], conicPts[2], weight);
paint.setColor(colors[i]);
canvas->drawPath(path, paint);
weight += 0.25f;
}
}