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
33
void draw(SkCanvas* canvas) {
canvas->clear(SK_ColorBLACK);
SkPoint points[3];
points[0].set(100, 10);
points[1].set(190, 190);
points[2].set(10, 190);
SkColor colors[3];
colors[0] = SK_ColorRED;
colors[1] = SK_ColorGREEN;
colors[2] = SK_ColorBLUE;
uint16_t indices[3];
indices[0] = 0;
indices[1] = 1;
indices[2] = 2;
sk_sp<SkVertices> vertices = SkVertices::MakeCopy(SkVertices::VertexMode::kTriangles_VertexMode,
3, points, nullptr, colors,
3, indices);
/*
sk_sp<SkVertices> vertices = SkVertices::MakeCopy(SkVertices::VertexMode::kTriangles_VertexMode,
3, points, nullptr, colors);
*/
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
paint.setColor(SK_ColorWHITE);
//paint.setShader(SkGradientShader::MakeLinear(points, colors, nullptr, 3, SkTileMode::kClamp));
canvas->drawVertices(vertices, SkBlendMode::kSrcOver, paint);
}