Mercurial > MadButterfly
diff 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 |
line wrap: on
line diff
--- a/include/mb_graph_engine_openvg.h Sun Jul 04 00:16:43 2010 +0800 +++ b/include/mb_graph_engine_openvg.h Sun Jul 04 15:36:40 2010 +0800 @@ -22,8 +22,6 @@ #define mbe_pattern_create_radial(cx0, cy0, radius0, \ cx1, cy1, radius1, stops, stop_cnt) \ ((mbe_pattern_t *)NULL) -#define mbe_pattern_create_linear(x0, y0, x1, y1, stops, stop_cnt) \ - ((mbe_pattern_t *)NULL) #define mbe_pattern_create_image(img) ((mbe_pattern_t *)NULL) #define mbe_scaled_font_destroy(scaled) #define mbe_font_face_reference(face) ((mbe_font_face_t *)NULL) @@ -138,22 +136,32 @@ extern EGLNativeDisplayType _ge_openvg_disp_id; extern mbe_t *_ge_openvg_current_canvas; +extern mbe_pattern_t *mbe_pattern_create_linear(co_aix x0, co_aix y0, + co_aix x1, co_aix y1, + grad_stop_t *stops, + int stop_cnt); extern void mbe_set_source_rgba(mbe_t *canvas, co_comp_t r, co_comp_t g, co_comp_t b, co_comp_t a); +/* TODO: rename n_areas to areas_cnt and make it after areas */ extern void mbe_scissoring(mbe_t *canvas, int n_areas, area_t **areas); #define _VG_DISPLAY() eglGetDisplay(_ge_openvg_disp_id) /* \brief Make the context of a canvas to be current context. + * + * TODO: swtich VGImage between VGPaint and Surface. */ #define _MK_CURRENT_CTX(canvas) do { \ if(_ge_openvg_current_canvas != (canvas)) { \ _ge_openvg_current_canvas = canvas; \ - eglMakeCurrent(_VG_DISPLAY(), (canvas)->tgt, \ - (canvas)->tgt, (canvas)->ctx); \ + eglMakeCurrent(_VG_DISPLAY(), \ + (canvas)->tgt->surface, \ + (canvas)->tgt->surface, \ + (canvas)->ctx); \ } \ } while(0) +/* TODO: switch VGImage between VGPaint and surface. */ #define _MK_CURRENT_PAINT(canvas) \ if((canvas)->paint_installed) \ vgSetPaint((canvas)->paint, VG_FILL_PATH|VG_STROKE_PATH)