Mercurial > MadButterfly
comparison include/mb_graph_engine_openvg.h @ 616:7d70a811829b openvg
mbe_fill_preserve() and mbe_reset_scissoring() for OpenVG
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Thu, 08 Jul 2010 11:37:33 +0800 |
parents | 0f0abc48e10a |
children | 89fee368e367 |
comparison
equal
deleted
inserted
replaced
615:0f0abc48e10a | 616:7d70a811829b |
---|---|
29 #define mbe_free_font_face(face) | 29 #define mbe_free_font_face(face) |
30 #define mbe_set_line_width(canvas, w) | 30 #define mbe_set_line_width(canvas, w) |
31 #define mbe_set_source_rgb(canvas, r, g, b) \ | 31 #define mbe_set_source_rgb(canvas, r, g, b) \ |
32 mbe_set_source_rgba(canvas, r, g, b, 1) | 32 mbe_set_source_rgba(canvas, r, g, b, 1) |
33 #define mbe_get_font_face(canvas) ((mbe_font_face_t *)NULL) | 33 #define mbe_get_font_face(canvas) ((mbe_font_face_t *)NULL) |
34 #define mbe_fill_preserve(canvas) | |
35 #define mbe_copy_source(src_canvas, dst_canvas) | 34 #define mbe_copy_source(src_canvas, dst_canvas) |
36 #define mbe_set_source(canvas, pattern) \ | 35 #define mbe_set_source(canvas, pattern) \ |
37 do { \ | 36 do { \ |
38 (canvas)->src = (pattern); \ | 37 (canvas)->src = (pattern); \ |
39 (canvas)->paint = (pattern)->paint; \ | 38 (canvas)->paint = (pattern)->paint; \ |
40 (canvas)->paint_installed = 0; \ | 39 (canvas)->paint_installed = 0; \ |
41 } while(0) | 40 } while(0) |
42 #define mbe_reset_scissoring(canvas) | 41 #define mbe_reset_scissoring(canvas) \ |
42 do { \ | |
43 _MK_CURRENT_CTX(canvas); \ | |
44 vgSeti(VG_SCISSORING, VG_FALSE); \ | |
45 } while(0) | |
43 #define mbe_get_target(canvas) ((mbe_surface_t *)(canvas)->tgt) | 46 #define mbe_get_target(canvas) ((mbe_surface_t *)(canvas)->tgt) |
44 #define mbe_close_path(canvas) | 47 #define mbe_close_path(canvas) |
45 #define mbe_text_path(canvas, utf8) | 48 #define mbe_text_path(canvas, utf8) |
46 #define mbe_rectangle(canvas, x, y, w, h) | 49 #define mbe_rectangle(canvas, x, y, w, h) |
47 #define mbe_in_stroke(canvas, x, y) (0) | 50 #define mbe_in_stroke(canvas, x, y) (0) |
230 vgDrawPath(canvas->path, VG_STROKE_PATH); | 233 vgDrawPath(canvas->path, VG_STROKE_PATH); |
231 vgClearPath(canvas->path, VG_PATH_CAPABILITY_ALL); | 234 vgClearPath(canvas->path, VG_PATH_CAPABILITY_ALL); |
232 } | 235 } |
233 | 236 |
234 static void | 237 static void |
235 mbe_fill(mbe_t *canvas) { | 238 mbe_fill_preserve(mbe_t *canvas) { |
236 _MK_CURRENT_CTX(canvas); | 239 _MK_CURRENT_CTX(canvas); |
237 _MK_CURRENT_PAINT(canvas); | 240 _MK_CURRENT_PAINT(canvas); |
238 if(canvas->src) | 241 if(canvas->src) |
239 _mbe_load_pattern_mtx(canvas->src->mtx, NULL, | 242 _mbe_load_pattern_mtx(canvas->src->mtx, NULL, |
240 VG_MATRIX_FILL_PAINT_TO_USER); | 243 VG_MATRIX_FILL_PAINT_TO_USER); |
241 | 244 |
242 vgDrawPath(canvas->path, VG_FILL_PATH); | 245 vgDrawPath(canvas->path, VG_FILL_PATH); |
246 } | |
247 | |
248 static void | |
249 mbe_fill(mbe_t *canvas) { | |
250 mbe_fill_preserve(canvas); | |
243 vgClearPath(canvas->path, VG_PATH_CAPABILITY_ALL); | 251 vgClearPath(canvas->path, VG_PATH_CAPABILITY_ALL); |
244 } | 252 } |
245 | 253 |
246 /* @} */ | 254 /* @} */ |
247 | 255 |