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
17
void draw(SkCanvas* canvas) {
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style);
SkMatrix matrix;
matrix.reset();
const SkVector radii[] = {{8, 4}, {9, 1}, {6, 2}, {7, 3}};
for (int i = 0; i < 4; ++i) {
SkVector rScaled[4];
matrix.preScale(1.5f, 2.f);
matrix.mapVectors(rScaled, radii, std::size(radii));
SkRRect rrect;
rrect.setRectRadii({20, 20, 180, 70}, rScaled);
canvas->drawRRect(rrect, paint);
canvas->translate(0, 60);
}
}