[C API] Add convenience SkCanvas draw circle
authorMiguel de Icaza <miguel@gnome.org>
Wed, 29 Jun 2016 00:17:42 +0000 (20:17 -0400)
committerMiguel de Icaza <miguel@gnome.org>
Wed, 29 Jun 2016 00:17:42 +0000 (20:17 -0400)
include/c/xamarin/sk_x_canvas.h
src/c/xamarin/sk_x_canvas.cpp

index 1ba80e71d0a53ff2368f13e6844704b63f46c119..024e9e7c5975f198ed6e04d30e72479e4cc12b39 100644 (file)
@@ -131,6 +131,11 @@ SK_API bool sk_canvas_get_clip_bounds(sk_canvas_t* t, sk_rect_t* cbounds);
 */
 SK_API bool sk_canvas_get_clip_device_bounds(sk_canvas_t* t, sk_irect_t* cbounds);
 
+/**
+   Draws a circle at cx, cy, with the specified radius and paint
+*/
+void sk_canvas_draw_circle (sk_canvas_t* ccanvas, float cx, float cy, float radius, const sk_paint_t* cpaint);
+
 SK_C_PLUS_PLUS_END_GUARD
 
 #endif
index de1a5f5b2579b119a00fb052c6d5474c81398799..bd06b7f065a9f3e42af72af411d705ca4bb0e131 100644 (file)
@@ -63,6 +63,11 @@ void sk_canvas_draw_text (sk_canvas_t* ccanvas, const char *text, size_t byteLen
     AsCanvas(ccanvas)->drawText(text, byteLength, x, y, *AsPaint(cpaint));
 }
 
+void sk_canvas_draw_circle (sk_canvas_t* ccanvas, float cx, float cy, float radius, const sk_paint_t* cpaint)
+{
+    AsCanvas(ccanvas)->drawCircle(cx, cy, radius, *AsPaint(cpaint));
+}
+
 void sk_canvas_draw_pos_text (sk_canvas_t* ccanvas, const char *text, size_t byteLength, const sk_point_t pos[], const sk_paint_t* cpaint)
 {
     AsCanvas(ccanvas)->drawPosText(text, byteLength, AsPoint(pos), *AsPaint(cpaint));
@@ -137,3 +142,4 @@ bool sk_canvas_get_clip_bounds(sk_canvas_t* ccanvas, sk_rect_t* cbounds) {
 bool sk_canvas_get_clip_device_bounds(sk_canvas_t* ccanvas, sk_irect_t* cbounds) {
     return AsCanvas(ccanvas)->getClipDeviceBounds(AsIRect(cbounds));
 }
+