Mercurial > MadButterfly
comparison include/mb_graph_engine_openvg.h @ 604:38514a7c6b26 openvg
Linear gradient for OpenVG
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sun, 04 Jul 2010 15:36:40 +0800 |
parents | 39d27911c3ae |
children | e21eb54c7d9c |
comparison
equal
deleted
inserted
replaced
603:39d27911c3ae | 604:38514a7c6b26 |
---|---|
19 #define mbe_image_surface_get_width(surface) (1) | 19 #define mbe_image_surface_get_width(surface) (1) |
20 #define mbe_image_surface_get_data(surface) ((unsigned char *)NULL) | 20 #define mbe_image_surface_get_data(surface) ((unsigned char *)NULL) |
21 #define mbe_scaled_font_reference(scaled) ((mbe_scaled_font_t *)NULL) | 21 #define mbe_scaled_font_reference(scaled) ((mbe_scaled_font_t *)NULL) |
22 #define mbe_pattern_create_radial(cx0, cy0, radius0, \ | 22 #define mbe_pattern_create_radial(cx0, cy0, radius0, \ |
23 cx1, cy1, radius1, stops, stop_cnt) \ | 23 cx1, cy1, radius1, stops, stop_cnt) \ |
24 ((mbe_pattern_t *)NULL) | |
25 #define mbe_pattern_create_linear(x0, y0, x1, y1, stops, stop_cnt) \ | |
26 ((mbe_pattern_t *)NULL) | 24 ((mbe_pattern_t *)NULL) |
27 #define mbe_pattern_create_image(img) ((mbe_pattern_t *)NULL) | 25 #define mbe_pattern_create_image(img) ((mbe_pattern_t *)NULL) |
28 #define mbe_scaled_font_destroy(scaled) | 26 #define mbe_scaled_font_destroy(scaled) |
29 #define mbe_font_face_reference(face) ((mbe_font_face_t *)NULL) | 27 #define mbe_font_face_reference(face) ((mbe_font_face_t *)NULL) |
30 #define mbe_scaled_font_create(face, fnt_mtx, ctm) ((mbe_scaled_font_t *)NULL) | 28 #define mbe_scaled_font_create(face, fnt_mtx, ctm) ((mbe_scaled_font_t *)NULL) |
136 } while(0) | 134 } while(0) |
137 | 135 |
138 extern EGLNativeDisplayType _ge_openvg_disp_id; | 136 extern EGLNativeDisplayType _ge_openvg_disp_id; |
139 extern mbe_t *_ge_openvg_current_canvas; | 137 extern mbe_t *_ge_openvg_current_canvas; |
140 | 138 |
139 extern mbe_pattern_t *mbe_pattern_create_linear(co_aix x0, co_aix y0, | |
140 co_aix x1, co_aix y1, | |
141 grad_stop_t *stops, | |
142 int stop_cnt); | |
141 extern void mbe_set_source_rgba(mbe_t *canvas, co_comp_t r, co_comp_t g, | 143 extern void mbe_set_source_rgba(mbe_t *canvas, co_comp_t r, co_comp_t g, |
142 co_comp_t b, co_comp_t a); | 144 co_comp_t b, co_comp_t a); |
145 /* TODO: rename n_areas to areas_cnt and make it after areas */ | |
143 extern void mbe_scissoring(mbe_t *canvas, int n_areas, area_t **areas); | 146 extern void mbe_scissoring(mbe_t *canvas, int n_areas, area_t **areas); |
144 | 147 |
145 | 148 |
146 #define _VG_DISPLAY() eglGetDisplay(_ge_openvg_disp_id) | 149 #define _VG_DISPLAY() eglGetDisplay(_ge_openvg_disp_id) |
147 | 150 |
148 /* \brief Make the context of a canvas to be current context. | 151 /* \brief Make the context of a canvas to be current context. |
152 * | |
153 * TODO: swtich VGImage between VGPaint and Surface. | |
149 */ | 154 */ |
150 #define _MK_CURRENT_CTX(canvas) do { \ | 155 #define _MK_CURRENT_CTX(canvas) do { \ |
151 if(_ge_openvg_current_canvas != (canvas)) { \ | 156 if(_ge_openvg_current_canvas != (canvas)) { \ |
152 _ge_openvg_current_canvas = canvas; \ | 157 _ge_openvg_current_canvas = canvas; \ |
153 eglMakeCurrent(_VG_DISPLAY(), (canvas)->tgt, \ | 158 eglMakeCurrent(_VG_DISPLAY(), \ |
154 (canvas)->tgt, (canvas)->ctx); \ | 159 (canvas)->tgt->surface, \ |
160 (canvas)->tgt->surface, \ | |
161 (canvas)->ctx); \ | |
155 } \ | 162 } \ |
156 } while(0) | 163 } while(0) |
164 /* TODO: switch VGImage between VGPaint and surface. */ | |
157 #define _MK_CURRENT_PAINT(canvas) \ | 165 #define _MK_CURRENT_PAINT(canvas) \ |
158 if((canvas)->paint_installed) \ | 166 if((canvas)->paint_installed) \ |
159 vgSetPaint((canvas)->paint, VG_FILL_PATH|VG_STROKE_PATH) | 167 vgSetPaint((canvas)->paint, VG_FILL_PATH|VG_STROKE_PATH) |
160 | 168 |
161 static void | 169 static void |