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
18
void draw(SkCanvas* canvas) {
const SkPoint pts[] = { { 0.0, 0.0 }, { 16.0, 0.0 } };
const SkColor colors[] = { SkColorSetARGB(0x00, 0x2D, 0x2D, 0x2D), SkColorSetARGB(0xFF, 0x2D, 0x2D, 0x2D) };
const SkScalar pos[] = { 0.0, 1.0 };
auto shader = SkGradientShader::MakeLinear(pts, colors, pos, 2, SkTileMode::kClamp);
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
paint.setShader(shader);
const SkColor colors2[] = { SkColorSetARGB(0xFF, 0x2D, 0x2D, 0x2D), SkColorSetARGB(0xFF, 0x2D, 0x2D, 0x2D) };
auto shader2 = SkGradientShader::MakeLinear(pts, colors2, pos, 2, SkTileMode::kClamp);
SkPaint paint2;
paint2.setStyle(SkPaint::kFill_Style);
paint2.setShader(shader2);
canvas->drawRect(SkRect::MakeLTRB(0, 0, 16, 3), paint2);
canvas->drawRect(SkRect::MakeLTRB(0, 0, 16, 3), paint);
}