Mercurial > MadButterfly
changeset 621:d8cdd57ceff5 openvg
Various path functions for OpenVG
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 09 Jul 2010 10:45:23 +0800 |
parents | 3f544e876939 |
children | 39bd74da7f92 |
files | include/mb_graph_engine_openvg.h |
diffstat | 1 files changed, 17 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/include/mb_graph_engine_openvg.h Fri Jul 09 08:51:18 2010 +0800 +++ b/include/mb_graph_engine_openvg.h Fri Jul 09 10:45:23 2010 +0800 @@ -47,15 +47,29 @@ vgSeti(VG_SCISSORING, VG_FALSE); \ } while(0) #define mbe_get_target(canvas) ((mbe_surface_t *)(canvas)->tgt) -#define mbe_close_path(canvas) +#define mbe_close_path(canvas) \ + do { \ + char _vg_cmd = VG_CLOSE_PATH; \ + vgAppendPathData((canvas)->path, 1, &_vg_cmd, NULL); \ + } while(0) #define mbe_text_path(canvas, utf8) #define mbe_rectangle(canvas, x, y, w, h) #define mbe_in_stroke(canvas, x, y) (0) #define mbe_new_path(canvas) \ vgClearPath((canvas)->path, VG_PATH_CAPABILITY_ALL) #define mbe_curve_to(canvas, x1, y1, x2, y2, x3, y3) -#define mbe_move_to(canvas, x, y) -#define mbe_line_to(canvas, x, y) +#define mbe_move_to(canvas, x, y) \ + do { \ + VGfloat _vg_data[2] = {x, y}; \ + char _vg_cmd = VG_MOVE_TO_ABS; \ + vgAppendPathData((canvas)->path, 1, &_vg_cmd, _vg_data); \ + } while(0) +#define mbe_line_to(canvas, x, y) \ + do { \ + VGfloat _vg_data[2] = {x, y}; \ + char _vg_cmd = VG_LINE_TO_ABS; \ + vgAppendPathData((canvas)->path, 1, &_vg_cmd, _vg_data); \ + } while(0) #define mbe_in_fill(canvas, x, y) (0) /* TODO: change prototype of mbe_arc() to remove mbe_save() and * mbe_restore().