comparison include/mb_graph_engine_openvg.h @ 603:39d27911c3ae openvg

Remove mbe_image_surface_create_for_data()
author Thinker K.F. Li <thinker@branda.to>
date Sun, 04 Jul 2010 00:16:43 +0800
parents ac2e6468a22a
children 38514a7c6b26
comparison
equal deleted inserted replaced
602:ac2e6468a22a 603:39d27911c3ae
9 #include "mb_img_ldr.h" 9 #include "mb_img_ldr.h"
10 10
11 /*! \defgroup mb_ge_cairo MadButterfly Graphic Engine with Cairo 11 /*! \defgroup mb_ge_cairo MadButterfly Graphic Engine with Cairo
12 * @{ 12 * @{
13 */ 13 */
14 #define mbe_image_surface_create_for_data(data, fmt, w, h, stride) \
15 ((mbe_surface_t *)NULL)
16 #define mbe_pattern_create_for_surface(canvas) ((mbe_pattern_t *)NULL) 14 #define mbe_pattern_create_for_surface(canvas) ((mbe_pattern_t *)NULL)
17 #define mbe_scaled_font_text_extents(scaled, utf8, extents) 15 #define mbe_scaled_font_text_extents(scaled, utf8, extents)
18 #define mbe_image_surface_get_stride(surface) (20) 16 #define mbe_image_surface_get_stride(surface) (20)
19 #define mbe_image_surface_get_format(surface) ((mb_img_fmt_t)0) 17 #define mbe_image_surface_get_format(surface) ((mb_img_fmt_t)0)
20 #define mbe_image_surface_get_height(surface) (1) 18 #define mbe_image_surface_get_height(surface) (1)
69 typedef int mbe_scaled_font_t; 67 typedef int mbe_scaled_font_t;
70 typedef int mbe_font_face_t; 68 typedef int mbe_font_face_t;
71 typedef struct _ge_openvg_surface mbe_surface_t; 69 typedef struct _ge_openvg_surface mbe_surface_t;
72 typedef struct _ge_openvg_pattern mbe_pattern_t; 70 typedef struct _ge_openvg_pattern mbe_pattern_t;
73 typedef struct _ge_openvg_mbe mbe_t; 71 typedef struct _ge_openvg_mbe mbe_t;
72 typedef struct _ge_openvg_img _ge_openvg_img_t;
74 73
75 struct _mbe_text_extents_t { 74 struct _mbe_text_extents_t {
76 co_aix x_bearing; 75 co_aix x_bearing;
77 co_aix y_bearing; 76 co_aix y_bearing;
78 co_aix width; 77 co_aix width;
93 92
94 struct _ge_openvg_surface { 93 struct _ge_openvg_surface {
95 void *surface; 94 void *surface;
96 mbe_t *asso_mbe; /* There is a association between 95 mbe_t *asso_mbe; /* There is a association between
97 * surface and mbe */ 96 * surface and mbe */
97 _ge_openvg_img_t *asso_img;
98 int w, h; 98 int w, h;
99 }; 99 };
100 100
101 struct _ge_openvg_pattern { 101 struct _ge_openvg_pattern {
102 void *pattern; 102 _ge_openvg_img_t *asso_img;
103 void *asso_img;
104 VGPaint paint; 103 VGPaint paint;
104 };
105
106 /*! \brief Information associated with VGImage.
107 *
108 * A VGImage can associated one of pattern or surface. This type is
109 * used to make sure previous associated pattern or surface being
110 * released before new association.
111 *
112 * Functions must release assocation specified by
113 * _ge_openvg_img::asso_pattern or _ge_openvg_img::asso_surface before
114 * new association, and record new association as one of thes two
115 * vairables.
116 *
117 * \sa _ge_openvg_img_t
118 * \note This is type is for internal using of OpenVG graphic engine.
119 */
120 struct _ge_openvg_img {
121 VGImage img;
122 mbe_pattern_t *asso_pattern;
123 mbe_surface_t *asso_surface;
105 }; 124 };
106 125
107 #define MB_MATRIX_2_OPENVG(vgmtx, mtx) do { \ 126 #define MB_MATRIX_2_OPENVG(vgmtx, mtx) do { \
108 (vgmtx)[0] = (mtx)[0]; \ 127 (vgmtx)[0] = (mtx)[0]; \
109 (vgmtx)[1] = (mtx)[1]; \ 128 (vgmtx)[1] = (mtx)[1]; \
169 display = _VG_DISPLAY(); 188 display = _VG_DISPLAY();
170 eglDestroySurface(display, surface->surface); 189 eglDestroySurface(display, surface->surface);
171 190
172 if(surface->asso_mbe) 191 if(surface->asso_mbe)
173 surface->asso_mbe->tgt = NULL; 192 surface->asso_mbe->tgt = NULL;
193
194 if(surface->asso_img)
195 surface->asso_img->asso_surface = NULL;
174 196
175 free(surface); 197 free(surface);
176 } 198 }
177 199
178 extern mbe_t *mbe_create(mbe_surface_t *surface); 200 extern mbe_t *mbe_create(mbe_surface_t *surface);