comparison include/mb_graph_engine_openvg.h @ 583:ca57132020e4 openvg

Set transform matrix for VG contexts
author Thinker K.F. Li <thinker@branda.to>
date Wed, 30 Jun 2010 09:29:28 +0800
parents dd546c4da180
children 543a2a8523fb
comparison
equal deleted inserted replaced
582:dd546c4da180 583:ca57132020e4
52 do { (canvas)->src = (pattern); } while(0) 52 do { (canvas)->src = (pattern); } while(0)
53 #define mbe_reset_clip(canvas) 53 #define mbe_reset_clip(canvas)
54 #define mbe_get_target(canvas) ((mbe_surface_t *)(canvas)->tgt) 54 #define mbe_get_target(canvas) ((mbe_surface_t *)(canvas)->tgt)
55 #define mbe_close_path(canvas) 55 #define mbe_close_path(canvas)
56 #define mbe_text_path(canvas, utf8) 56 #define mbe_text_path(canvas, utf8)
57 #define mbe_transform(canvas, mtx)
58 #define mbe_rectangle(canvas, x, y, w, h) 57 #define mbe_rectangle(canvas, x, y, w, h)
59 #define mbe_in_stroke(canvas, x, y) (0) 58 #define mbe_in_stroke(canvas, x, y) (0)
60 #define mbe_new_path(canvas) 59 #define mbe_new_path(canvas)
61 #define mbe_curve_to(canvas, x1, y1, x2, y2, x3, y3) 60 #define mbe_curve_to(canvas, x1, y1, x2, y2, x3, y3)
62 #define mbe_restore(canvas) 61 #define mbe_restore(canvas)
104 void *asso_img; 103 void *asso_img;
105 }; 104 };
106 105
107 #define MB_MATRIX_2_OPENVG(vgmtx, mtx) do { \ 106 #define MB_MATRIX_2_OPENVG(vgmtx, mtx) do { \
108 (vgmtx)[0] = (mtx)[0]; \ 107 (vgmtx)[0] = (mtx)[0]; \
109 (vgmtx)[1] = (mtx)[3]; \ 108 (vgmtx)[1] = (mtx)[1]; \
110 (vgmtx)[2] = 0; \ 109 (vgmtx)[2] = (mtx)[2]; \
111 (vgmtx)[3] = (mtx)[1]; \ 110 (vgmtx)[3] = (mtx)[3]; \
112 (vgmtx)[4] = (mtx)[4]; \ 111 (vgmtx)[4] = (mtx)[4]; \
113 (vgmtx)[5] = 0; \ 112 (vgmtx)[5] = (mtx)[5]; \
114 (vgmtx)[6] = (mtx)[2]; \ 113 (vgmtx)[6] = 0; \
115 (vgmtx)[7] = (mtx)[5]; \ 114 (vgmtx)[7] = 0; \
116 (vgmtx)[8] = 1; \ 115 (vgmtx)[8] = 1; \
117 } while(0) 116 } while(0)
118 117
119 extern EGLNativeDisplayType _ge_openvg_disp_id; 118 extern EGLNativeDisplayType _ge_openvg_disp_id;
119
120 #define _MK_CURRENT_CTX(canvas) /* TODO: Make the context of a canvas
121 * as current context */
122
123 static void
124 mbe_transform(mbe_t *canvas, co_aix *mtx) {
125 VGfloat vg_mtx[9];
126
127 _MK_CURRENT_CTX(canvas);
128 MB_MATRIX_2_OPENVG(vg_mtx, mtx);
129 vgLoadMatrix(vg_mtx);
130 }
120 131
121 #define _VG_DISPLAY() eglGetDisplay(_ge_openvg_disp_id) 132 #define _VG_DISPLAY() eglGetDisplay(_ge_openvg_disp_id)
122 133
123 static int 134 static int
124 _openvg_find_confg(mb_img_fmt_t fmt, int w, int h, 135 _openvg_find_confg(mb_img_fmt_t fmt, int w, int h,