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
28
static constexpr float kPi = 3.14159265358979323846f;
void draw(SkCanvas* canvas) {
SkPaint p;
canvas->drawCircle(128, 128, 60, p);
p.setColor(0x88FF0000);
p.setAntiAlias(true);
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeCap(SkPaint::kSquare_Cap);
p.setStrokeWidth(80);
SkScalar interv[2] = {120 * kPi / 6 - 0.05f, 0.0000f};
p.setPathEffect(SkDashPathEffect::Make(interv, 0.5));
SkPath path, path2;
path.addCircle(128, 128, 60);
canvas->drawPath(path, p);
p.setColor(0x8800FF00);
SkScalar interv2[2] = {120 * kPi / 6 - 0.05f, 10000.0000f};
p.setPathEffect(SkDashPathEffect::Make(interv2, 0));
canvas->drawPath(path, p);
skpathutils::FillPathWithPaint(path, p, &path2);
p.setColor(0xFF000000);
p.setStrokeWidth(0);
p.setPathEffect(nullptr);
canvas->drawPath(path2, p);
}