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
24
void draw(SkCanvas* canvas) {
canvas->scale(2.0, 2.0);
canvas->drawColor(SK_ColorWHITE);
const char text[] = "Skia";
SkScalar adv[4];
SkPaint p;
p.setTextSize(21);
p.getTextWidths(text, 4, adv);
SkScalar w = p.measureText(text, 4);
const SkColor colors[] = { 0xFF0C6EE5, 0xFFD9452E, 0xFFFFB802, 0xFF009755 };
p.setAntiAlias(true);
SkScalar x = 0;
SkScalar y = p.getTextSize();
for (int i = 0; i < 4; ++i) {
p.setColor(colors[i]);
canvas->drawText(&text[i], 1, x, y, p);
x += adv[i];
}
}