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
22
void draw(SkCanvas* canvas) {
SkPaint conicPaint;
conicPaint.setAntiAlias(true);
conicPaint.setStyle(SkPaint::kStroke_Style);
SkPaint quadPaint(conicPaint);
quadPaint.setColor(SK_ColorRED);
SkPoint conic[] = { {20, 170}, {80, 170}, {80, 230} };
for (auto weight : { .25f, .5f, .707f, .85f, 1.f } ) {
SkPoint quads[5];
SkPath::ConvertConicToQuads(conic[0], conic[1], conic[2], weight, quads, 1);
SkPath path;
path.moveTo(conic[0]);
path.conicTo(conic[1], conic[2], weight);
canvas->drawPath(path, conicPaint);
path.rewind();
path.moveTo(quads[0]);
path.quadTo(quads[1], quads[2]);
path.quadTo(quads[3], quads[4]);
canvas->drawPath(path, quadPaint);
canvas->translate(50, -50);
}
}