From: reed Date: Tue, 9 Feb 2016 21:25:51 +0000 (-0800) Subject: add drawCircle to c api X-Git-Tag: submit/tizen/20180928.044319~129^2~2136 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a7940bf5e4de6396fd48bbfdbf883e696b19b35;p=platform%2Fupstream%2FlibSkiaSharp.git add drawCircle to c api BUG=skia:4927 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1684763002 TBR= Review URL: https://codereview.chromium.org/1684763002 --- diff --git a/include/c/sk_canvas.h b/include/c/sk_canvas.h index f6c0d4e1c1..1e1dd24f99 100644 --- a/include/c/sk_canvas.h +++ b/include/c/sk_canvas.h @@ -102,6 +102,11 @@ SK_API void sk_canvas_draw_paint(sk_canvas_t*, const sk_paint_t*); paint. */ SK_API void sk_canvas_draw_rect(sk_canvas_t*, const sk_rect_t*, const sk_paint_t*); +/** + * Draw the circle centered at (cx, cy) with radius rad using the specified paint. + * The circle will be filled or framed based on the style in the paint + */ +SK_API void sk_canvas_draw_circle(sk_canvas_t*, float cx, float cy, float rad, const sk_paint_t*); /** Draw the specified oval using the specified paint. The oval will be filled or framed based on the style in the paint diff --git a/src/c/sk_surface.cpp b/src/c/sk_surface.cpp index b8fbc63f63..6618881bc1 100644 --- a/src/c/sk_surface.cpp +++ b/src/c/sk_surface.cpp @@ -375,6 +375,11 @@ void sk_canvas_draw_rect(sk_canvas_t* ccanvas, const sk_rect_t* crect, const sk_ AsCanvas(ccanvas)->drawRect(AsRect(*crect), AsPaint(*cpaint)); } +void sk_canvas_draw_circle(sk_canvas_t* ccanvas, float cx, float cy, float rad, + const sk_paint_t* cpaint) { + AsCanvas(ccanvas)->drawCircle(cx, cy, rad, AsPaint(*cpaint)); +} + void sk_canvas_draw_oval(sk_canvas_t* ccanvas, const sk_rect_t* crect, const sk_paint_t* cpaint) { AsCanvas(ccanvas)->drawOval(AsRect(*crect), AsPaint(*cpaint)); }