SK_C_API void sk_canvas_draw_vertices(sk_canvas_t* ccanvas, sk_vertices_t* vertices, sk_blendmode_t mode, const sk_paint_t* paint);
+SK_C_API sk_nodraw_canvas_t* sk_nodraw_canvas_new(int width, int height);
+SK_C_API void sk_nodraw_canvas_destroy(sk_nodraw_canvas_t*);
+
+SK_C_API sk_nway_canvas_t* sk_nway_canvas_new(int width, int height);
+SK_C_API void sk_nway_canvas_destroy(sk_nway_canvas_t*);
+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_PLUS_PLUS_END_GUARD
#endif
and a stack of matrix/clip values.
*/
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;
/**
A sk_data_ holds an immutable data buffer.
*/
void sk_canvas_draw_vertices(sk_canvas_t* ccanvas, sk_vertices_t* vertices, sk_blendmode_t mode, const sk_paint_t* paint) {
AsCanvas(ccanvas)->drawVertices(AsVertices(vertices), (SkBlendMode)mode, AsPaint(*paint));
}
+
+sk_nodraw_canvas_t* sk_nodraw_canvas_new(int width, int height) {
+ return ToNoDrawCanvas(new SkNoDrawCanvas(width, height));
+}
+
+void sk_nodraw_canvas_destroy(sk_nodraw_canvas_t* t) {
+ delete AsNoDrawCanvas(t);
+}
+
+sk_nway_canvas_t* sk_nway_canvas_new(int width, int height) {
+ return ToNWayCanvas(new SkNWayCanvas(width, height));
+}
+
+void sk_nway_canvas_destroy(sk_nway_canvas_t* t) {
+ delete AsNWayCanvas(t);
+}
+
+void sk_nway_canvas_add_canvas(sk_nway_canvas_t* t, sk_canvas_t* canvas) {
+ AsNWayCanvas(t)->addCanvas(AsCanvas(canvas));
+}
+
+void sk_nway_canvas_remove_canvas(sk_nway_canvas_t* t, sk_canvas_t* canvas) {
+ AsNWayCanvas(t)->removeCanvas(AsCanvas(canvas));
+}
+
+void sk_nway_canvas_remove_all(sk_nway_canvas_t* t) {
+ AsNWayCanvas(t)->removeAll();
+}
#include "SkImageInfo.h"
#include "SkCanvas.h"
+#include "SkNoDrawCanvas.h"
+#include "SkNWayCanvas.h"
#include "SkSurface.h"
#include "SkVertices.h"
#include "SkBlurTypes.h"
return reinterpret_cast<SkCanvas*>(ccanvas);
}
+static inline sk_nodraw_canvas_t* ToNoDrawCanvas(SkNoDrawCanvas* canvas) {
+ return reinterpret_cast<sk_nodraw_canvas_t*>(canvas);
+}
+
+static inline SkNoDrawCanvas* AsNoDrawCanvas(sk_nodraw_canvas_t* ccanvas) {
+ return reinterpret_cast<SkNoDrawCanvas*>(ccanvas);
+}
+
+static inline sk_nway_canvas_t* ToNWayCanvas(SkNWayCanvas* canvas) {
+ return reinterpret_cast<sk_nway_canvas_t*>(canvas);
+}
+
+static inline SkNWayCanvas* AsNWayCanvas(sk_nway_canvas_t* ccanvas) {
+ return reinterpret_cast<SkNWayCanvas*>(ccanvas);
+}
+
static inline SkPictureRecorder* AsPictureRecorder(sk_picture_recorder_t* crec) {
return reinterpret_cast<SkPictureRecorder*>(crec);
}