comparison include/mb_graph_engine_openvg.h @ 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
comparison
equal deleted inserted replaced
620:3f544e876939 621:d8cdd57ceff5
45 do { \ 45 do { \
46 _MK_CURRENT_CTX(canvas); \ 46 _MK_CURRENT_CTX(canvas); \
47 vgSeti(VG_SCISSORING, VG_FALSE); \ 47 vgSeti(VG_SCISSORING, VG_FALSE); \
48 } while(0) 48 } while(0)
49 #define mbe_get_target(canvas) ((mbe_surface_t *)(canvas)->tgt) 49 #define mbe_get_target(canvas) ((mbe_surface_t *)(canvas)->tgt)
50 #define mbe_close_path(canvas) 50 #define mbe_close_path(canvas) \
51 do { \
52 char _vg_cmd = VG_CLOSE_PATH; \
53 vgAppendPathData((canvas)->path, 1, &_vg_cmd, NULL); \
54 } while(0)
51 #define mbe_text_path(canvas, utf8) 55 #define mbe_text_path(canvas, utf8)
52 #define mbe_rectangle(canvas, x, y, w, h) 56 #define mbe_rectangle(canvas, x, y, w, h)
53 #define mbe_in_stroke(canvas, x, y) (0) 57 #define mbe_in_stroke(canvas, x, y) (0)
54 #define mbe_new_path(canvas) \ 58 #define mbe_new_path(canvas) \
55 vgClearPath((canvas)->path, VG_PATH_CAPABILITY_ALL) 59 vgClearPath((canvas)->path, VG_PATH_CAPABILITY_ALL)
56 #define mbe_curve_to(canvas, x1, y1, x2, y2, x3, y3) 60 #define mbe_curve_to(canvas, x1, y1, x2, y2, x3, y3)
57 #define mbe_move_to(canvas, x, y) 61 #define mbe_move_to(canvas, x, y) \
58 #define mbe_line_to(canvas, x, y) 62 do { \
63 VGfloat _vg_data[2] = {x, y}; \
64 char _vg_cmd = VG_MOVE_TO_ABS; \
65 vgAppendPathData((canvas)->path, 1, &_vg_cmd, _vg_data); \
66 } while(0)
67 #define mbe_line_to(canvas, x, y) \
68 do { \
69 VGfloat _vg_data[2] = {x, y}; \
70 char _vg_cmd = VG_LINE_TO_ABS; \
71 vgAppendPathData((canvas)->path, 1, &_vg_cmd, _vg_data); \
72 } while(0)
59 #define mbe_in_fill(canvas, x, y) (0) 73 #define mbe_in_fill(canvas, x, y) (0)
60 /* TODO: change prototype of mbe_arc() to remove mbe_save() and 74 /* TODO: change prototype of mbe_arc() to remove mbe_save() and
61 * mbe_restore(). 75 * mbe_restore().
62 */ 76 */
63 #define mbe_save(canvas) 77 #define mbe_save(canvas)