# HG changeset patch # User Thinker K.F. Li # Date 1278643523 -28800 # Node ID d8cdd57ceff5299ac72c9555f30cab9f6915b02d # Parent 3f544e8769391dc2abe0d3f9795f2eba561f2deb Various path functions for OpenVG diff -r 3f544e876939 -r d8cdd57ceff5 include/mb_graph_engine_openvg.h --- 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().