Mercurial > MadButterfly
comparison include/mb_graph_engine_openvg.h @ 584:543a2a8523fb openvg
Make surce current VG context
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 30 Jun 2010 09:44:17 +0800 |
parents | ca57132020e4 |
children | 6af1aa74e57c |
comparison
equal
deleted
inserted
replaced
583:ca57132020e4 | 584:543a2a8523fb |
---|---|
114 (vgmtx)[7] = 0; \ | 114 (vgmtx)[7] = 0; \ |
115 (vgmtx)[8] = 1; \ | 115 (vgmtx)[8] = 1; \ |
116 } while(0) | 116 } while(0) |
117 | 117 |
118 extern EGLNativeDisplayType _ge_openvg_disp_id; | 118 extern EGLNativeDisplayType _ge_openvg_disp_id; |
119 | 119 extern mbe_t *_ge_openvg_current_canvas; |
120 #define _MK_CURRENT_CTX(canvas) /* TODO: Make the context of a canvas | 120 |
121 * as current context */ | 121 #define _VG_DISPLAY() eglGetDisplay(_ge_openvg_disp_id) |
122 | |
123 /* \brief Make the context of a canvas to be current context. | |
124 */ | |
125 #define _MK_CURRENT_CTX(canvas) do { \ | |
126 if(_ge_openvg_current_canvas != (canvas)) { \ | |
127 _ge_openvg_current_canvas = canvas; \ | |
128 eglMakeCurrent(_VG_DISPLAY(), (canvas)->tgt, \ | |
129 (canvas)->tgt, (canvas)->ctx); \ | |
130 } \ | |
131 } while(0) | |
122 | 132 |
123 static void | 133 static void |
124 mbe_transform(mbe_t *canvas, co_aix *mtx) { | 134 mbe_transform(mbe_t *canvas, co_aix *mtx) { |
125 VGfloat vg_mtx[9]; | 135 VGfloat vg_mtx[9]; |
126 | 136 |
127 _MK_CURRENT_CTX(canvas); | 137 _MK_CURRENT_CTX(canvas); |
128 MB_MATRIX_2_OPENVG(vg_mtx, mtx); | 138 MB_MATRIX_2_OPENVG(vg_mtx, mtx); |
129 vgLoadMatrix(vg_mtx); | 139 vgLoadMatrix(vg_mtx); |
130 } | 140 } |
131 | |
132 #define _VG_DISPLAY() eglGetDisplay(_ge_openvg_disp_id) | |
133 | 141 |
134 static int | 142 static int |
135 _openvg_find_confg(mb_img_fmt_t fmt, int w, int h, | 143 _openvg_find_confg(mb_img_fmt_t fmt, int w, int h, |
136 EGLConfig *config) { | 144 EGLConfig *config) { |
137 EGLDisplay display; | 145 EGLDisplay display; |