Mercurial > MadButterfly
comparison include/mb_graph_engine_cairo.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 | bd18951b51d5 |
comparison
equal
deleted
inserted
replaced
602:ac2e6468a22a | 603:39d27911c3ae |
---|---|
135 cairo_font_options_destroy(options); | 135 cairo_font_options_destroy(options); |
136 | 136 |
137 return scaled; | 137 return scaled; |
138 } | 138 } |
139 | 139 |
140 static mbe_surface_t * | |
141 mbe_image_surface_create_for_data(unsigned char *data, | |
142 mb_img_fmt_t fmt, | |
143 int width, int height, | |
144 int stride) { | |
145 cairo_format_t _fmt; | |
146 | |
147 switch(fmt) { | |
148 case MB_IFMT_ARGB32: | |
149 _fmt = CAIRO_FORMAT_ARGB32; | |
150 break; | |
151 case MB_IFMT_RGB24: | |
152 _fmt = CAIRO_FORMAT_RGB24; | |
153 break; | |
154 case MB_IFMT_A8: | |
155 _fmt = CAIRO_FORMAT_A8; | |
156 break; | |
157 case MB_IFMT_A1: | |
158 _fmt = CAIRO_FORMAT_A1; | |
159 break; | |
160 default: | |
161 return NULL; | |
162 } | |
163 return cairo_image_surface_create_for_data(data, _fmt, | |
164 width, height, stride); | |
165 } | |
166 | |
167 static mb_img_fmt_t | 140 static mb_img_fmt_t |
168 mbe_image_surface_get_format(mbe_surface_t *surface) { | 141 mbe_image_surface_get_format(mbe_surface_t *surface) { |
169 cairo_format_t _fmt; | 142 cairo_format_t _fmt; |
170 mb_img_fmt_t fmt; | 143 mb_img_fmt_t fmt; |
171 | 144 |