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
16
void draw(SkCanvas* canvas) {
const char pathString[] =
"M209 160C216.02 160 222.83 158.625 229.24 155.914C235.432 153.295 240.994 149.545 245.77 144.77C250.545 139.994 254.295 134.432 256.914 128.24C259.625 121.83 261 115.02 261 108L261 53C261 45.9796 259.625 39.1697 256.914 32.7596C254.295 26.5676 250.545 21.0064 245.77 16.2304C240.994 11.4545 235.432 7.705 229.24 5.086C222.83 2.37473 216.02 1 209 1L53 1C45.9796 1 39.1697 2.37473 32.7596 5.086C26.5676 7.705 21.0064 11.4545 16.2304 16.2304C11.4545 21.0064 7.705 26.5676 5.086 32.7596C2.37473 39.1697 1 45.9796 1 53L1 108C1 115.02 2.37473 121.83 5.086 128.24C7.705 134.432 11.4545 139.994 16.2304 144.77C21.0064 149.545 26.5676 153.295 32.7596 155.914C39.1697 158.625 45.9796 160 53 160L209 160M209 161L53 161C23.7289 161 0 137.271 0 108L0 53C0 23.7289 23.7289 0 53 0L209 0C238.271 0 262 23.7289 262 53L262 108C262 137.271 238.271 161 209 161Z";
SkPath path;
SkParsePath::FromSVGString(pathString, &path);
SkPaint paint;
paint.setAntiAlias(true);
canvas->translate(50, 50);
paint.setStyle(SkPaint::kFill_Style);
paint.setStrokeCap(SkPaint::kRound_Cap);
// paint.setStrokeWidth(3);
canvas->drawPath(path, paint);
}