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
35
void draw(SkCanvas* canvas) {
canvas->clear(SK_ColorBLACK);
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
paint.setColor(SK_ColorWHITE);
paint.setAntiAlias(true);
SkSamplingOptions sampling_options(SkFilterMode::kLinear);
canvas->drawImage(image, 0, 0, sampling_options, &paint);
SkPath path;
path.setFillType(SkPathFillType::kEvenOdd);
path.moveTo(SkBits2Float(0x3dd4fdf4), SkBits2Float(0x3f78a3d8)); // 0.104000002f, 0.971250057f
path.lineTo(SkBits2Float(0x3dd4fdf4), SkBits2Float(0x3d7ef9e0)); // 0.104000002f, 0.0622500181f
path.lineTo(SkBits2Float(0x3f378d50), SkBits2Float(0x3d7ef9e0)); // 0.717000008f, 0.0622500181f
path.lineTo(SkBits2Float(0x3f378d50), SkBits2Float(0x3e2d4fe0)); // 0.717000008f, 0.169250011f
path.lineTo(SkBits2Float(0x3e656042), SkBits2Float(0x3e2d4fe0)); // 0.224000007f, 0.169250011f
path.lineTo(SkBits2Float(0x3e656042), SkBits2Float(0x3ee70a3e)); // 0.224000007f, 0.451250017f
path.lineTo(SkBits2Float(0x3f26a7f0), SkBits2Float(0x3ee70a3e)); // 0.651000023f, 0.451250017f
path.lineTo(SkBits2Float(0x3f26a7f0), SkBits2Float(0x3f0ee97a)); // 0.651000023f, 0.55825007f
path.lineTo(SkBits2Float(0x3e656042), SkBits2Float(0x3f0ee97a)); // 0.224000007f, 0.55825007f
path.lineTo(SkBits2Float(0x3e656042), SkBits2Float(0x3f78a3d8)); // 0.224000007f, 0.971250057f
path.lineTo(SkBits2Float(0x3dd4fdf4), SkBits2Float(0x3f78a3d8)); // 0.104000002f, 0.971250057f
path.close();
paint.setColor(SK_ColorRED);
paint.setBlendMode(SkBlendMode::kMultiply);
SkMatrix matrix = SkMatrix::Scale(100, 100);
canvas->setMatrix(matrix);
canvas->drawPath(path, paint);
}