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
41
void draw(SkCanvas* skc) {
sk_canvas_t* canvas = (sk_canvas_t*)skc;
SkASSERT(canvas);
sk_paint_t* paint = sk_paint_new();
SkASSERT(paint);
sk_paint_set_color(paint, sk_color_set_argb(0xFF, 0x00, 0x00, 0xFF));
sk_canvas_draw_paint(canvas, paint);
sk_paint_set_color(paint, sk_color_set_argb(0xFF, 0x00, 0xFF, 0xFF));
sk_rect_t rect;
rect.left = 100.0f;
rect.top = 100.0f;
rect.right = 540.0f;
rect.bottom = 380.0f;
sk_canvas_draw_rect(canvas, &rect, paint);
sk_paint_t* stroke = sk_paint_new();
sk_paint_set_color(stroke, sk_color_set_argb(0xFF, 0xFF, 0x00, 0x00));
sk_paint_set_antialias(stroke, true);
sk_paint_set_stroke(stroke, true);
sk_paint_set_stroke_width(stroke, 5.0f);
sk_path_t* path = sk_path_new();
SkASSERT(path);
sk_path_move_to(path, 50.0f, 50.0f);
sk_path_line_to(path, 590.0f, 50.0f);
sk_path_cubic_to(path, -490.0f, 50.0f, 1130.0f, 430.0f, 50.0f, 430.0f);
sk_path_line_to(path, 590.0f, 430.0f);
sk_canvas_draw_path(canvas, path, stroke);
sk_paint_set_color(paint, sk_color_set_argb(0x80, 0x00, 0xFF, 0x00));
sk_rect_t rect2;
rect2.left = 120.0f;
rect2.top = 120.0f;
rect2.right = 520.0f;
rect2.bottom = 360.0f;
sk_canvas_draw_oval(canvas, &rect2, paint);
sk_path_delete(path);
sk_paint_delete(stroke);
sk_paint_delete(paint);
}