diff --git a/include/c/sk_canvas.h b/include/c/sk_canvas.h index aac958e4a705..83949ecdd7e5 100644 --- a/include/c/sk_canvas.h +++ b/include/c/sk_canvas.h @@ -79,6 +79,9 @@ SK_C_API void sk_nway_canvas_add_canvas(sk_nway_canvas_t*, sk_canvas_t* canvas); SK_C_API void sk_nway_canvas_remove_canvas(sk_nway_canvas_t*, sk_canvas_t* canvas); SK_C_API void sk_nway_canvas_remove_all(sk_nway_canvas_t*); +SK_C_API sk_overdraw_canvas_t* sk_overdraw_canvas_new(sk_canvas_t* canvas); +SK_C_API void sk_overdraw_canvas_destroy(sk_overdraw_canvas_t* canvas); + SK_C_PLUS_PLUS_END_GUARD #endif diff --git a/include/c/sk_types.h b/include/c/sk_types.h index c75dbc7dfe7c..6ec310c9db31 100644 --- a/include/c/sk_types.h +++ b/include/c/sk_types.h @@ -186,6 +186,7 @@ typedef enum { typedef struct sk_canvas_t sk_canvas_t; typedef struct sk_nodraw_canvas_t sk_nodraw_canvas_t; typedef struct sk_nway_canvas_t sk_nway_canvas_t; +typedef struct sk_overdraw_canvas_t sk_overdraw_canvas_t; /** A sk_data_ holds an immutable data buffer. */ diff --git a/src/c/sk_canvas.cpp b/src/c/sk_canvas.cpp index b8d4352378a3..d3e88cd0dc53 100644 --- a/src/c/sk_canvas.cpp +++ b/src/c/sk_canvas.cpp @@ -11,6 +11,7 @@ #include "SkAnnotation.h" #include "SkNoDrawCanvas.h" #include "SkNWayCanvas.h" +#include "SkOverdrawCanvas.h" #include "sk_canvas.h" @@ -329,3 +330,11 @@ void sk_nway_canvas_remove_canvas(sk_nway_canvas_t* t, sk_canvas_t* canvas) { void sk_nway_canvas_remove_all(sk_nway_canvas_t* t) { AsNWayCanvas(t)->removeAll(); } + +sk_overdraw_canvas_t* sk_overdraw_canvas_new(sk_canvas_t* canvas) { + return ToOverdrawCanvas(new SkOverdrawCanvas(AsCanvas(canvas))); +} + +void sk_overdraw_canvas_destroy(sk_overdraw_canvas_t* canvas) { + delete AsOverdrawCanvas(canvas); +} diff --git a/src/c/sk_types_priv.h b/src/c/sk_types_priv.h index 7af60988069a..9909712b2080 100644 --- a/src/c/sk_types_priv.h +++ b/src/c/sk_types_priv.h @@ -79,6 +79,7 @@ DEF_CLASS_MAP(SkMatrix44, sk_matrix44_t, Matrix44) DEF_CLASS_MAP(SkMemoryStream, sk_stream_memorystream_t, MemoryStream) DEF_CLASS_MAP(SkNWayCanvas, sk_nway_canvas_t, NWayCanvas) DEF_CLASS_MAP(SkNoDrawCanvas, sk_nodraw_canvas_t, NoDrawCanvas) +DEF_CLASS_MAP(SkOverdrawCanvas, sk_overdraw_canvas_t, OverdrawCanvas) DEF_CLASS_MAP(SkOpBuilder, sk_opbuilder_t, OpBuilder) DEF_CLASS_MAP(SkPaint, sk_paint_t, Paint) DEF_CLASS_MAP(SkPath, sk_path_t, Path)