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
19
// draw_vertices
void draw(SkCanvas* canvas) {
SkPaint p;
p.setAntiAlias(true);
SkPoint pts[3] = {{64, 32}, {0, 224}, {128, 224}};
SkColor colors[3] = {SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN};
canvas->drawVertices(
SkVertices::MakeCopy(SkVertices::kTriangles_VertexMode, 3, pts, nullptr, colors),
SkBlendMode::kDst, p);
canvas->translate(120, 0);
p.setShader(image->makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat, SkSamplingOptions()));
SkPoint texs[3] = {{0, 0}, {0, 128}, {64, 256}};
canvas->drawVertices(
SkVertices::MakeCopy(SkVertices::kTriangles_VertexMode, 3, pts, texs, nullptr),
SkBlendMode::kDst, p);
}