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) {
SkPoint pts[2] = { { 250, 0 }, { 250, 500 }};
SkColor colors[2];
SkScalar pos[2];
for (int i = 0; i < 2; ++i) {
colors[i] = (i & 1) ? 0xff808080 : 0xff656565;
pos[i] = SK_Scalar1 * i / (2 - 1);
}
sk_sp<SkShader> grad(SkGradientShader::MakeLinear(pts,
colors,
pos,
2,
SkShader::kClamp_TileMode));
SkPaint p;
p.setStyle(SkPaint::kFill_Style);
p.setAntiAlias(true);
p.setShader(grad);
canvas->drawRect(SkRect::MakeWH(500, 500), p);
}