Skip to content

Commit

Permalink
Added bindings for SkOverdrawCanvas
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Jul 21, 2018
1 parent b12b309 commit d42756a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/c/sk_canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions include/c/sk_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
9 changes: 9 additions & 0 deletions src/c/sk_canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "SkAnnotation.h"
#include "SkNoDrawCanvas.h"
#include "SkNWayCanvas.h"
#include "SkOverdrawCanvas.h"

#include "sk_canvas.h"

Expand Down Expand Up @@ -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);
}
1 change: 1 addition & 0 deletions src/c/sk_types_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d42756a

Please sign in to comment.