aboutsummaryrefslogtreecommitdiff
path: root/canvas.lv2/render_nanovg.h
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2019-04-06 21:33:37 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2019-04-06 21:33:37 +0200
commit054228e51c47fdf3c050a40190c29c74839fe245 (patch)
tree397163290ba3e8b3627919c84b3c26a486d53d1a /canvas.lv2/render_nanovg.h
parent01fbfd95ac6ed82a651f1c26062ae04b801060fc (diff)
downloadcanvas.lv2-054228e51c47fdf3c050a40190c29c74839fe245.tar.xz
add inline_display wrapper.
Diffstat (limited to 'canvas.lv2/render_nanovg.h')
-rw-r--r--canvas.lv2/render_nanovg.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/canvas.lv2/render_nanovg.h b/canvas.lv2/render_nanovg.h
index 3051afa..7df0661 100644
--- a/canvas.lv2/render_nanovg.h
+++ b/canvas.lv2/render_nanovg.h
@@ -533,11 +533,12 @@ lv2_canvas_init(LV2_Canvas *canvas, LV2_URID_Map *map)
}
static inline bool
-lv2_canvas_render(LV2_Canvas *canvas, NVGcontext *ctx, const LV2_Atom_Tuple *tup)
+lv2_canvas_render_body(LV2_Canvas *canvas, cairo_t *ctx, uint32_t type,
+ uint32_t size, const LV2_Atom *body)
{
LV2_Canvas_URID *urid = &canvas->urid;
- if(!tup || (tup->atom.type != urid->forge.Tuple) )
+ if(!body || (type != urid->forge.Tuple) )
return false;
// save state
@@ -554,7 +555,7 @@ lv2_canvas_render(LV2_Canvas *canvas, NVGcontext *ctx, const LV2_Atom_Tuple *tup
nvgStrokeColor(ctx, nvgRGBA(0xff, 0xff, 0xff, 0xff));
nvgFillColor(ctx, nvgRGBA(0xff, 0xff, 0xff, 0xff));
- LV2_ATOM_TUPLE_FOREACH(tup, itm)
+ LV2_ATOM_TUPLE_BODY_FOREACH(body, size, itm)
{
if(lv2_atom_forge_is_object_type(&urid->forge, itm->type))
{
@@ -579,6 +580,13 @@ lv2_canvas_render(LV2_Canvas *canvas, NVGcontext *ctx, const LV2_Atom_Tuple *tup
return true;
}
+static inline bool
+lv2_canvas_render(LV2_Canvas *canvas, NVGcontext *ctx, const LV2_Atom_Tuple *tup)
+{
+ return lv2_canvas_render_body(canvas, ctx, tup->atom.type, tup->atom.size,
+ LV2_ATOM_BODY_CONST(&tup->atom));
+}
+
#ifdef __cplusplus
}
#endif