comparison src/paint.c @ 348:04d22dc38bc0

Change declaration of sh_image_set_img_data(). - x, y, w, h are not passed to sh_image_set_img_data() any more. - Applications should manage life-cycle of mb_img_data_t, paint_image_t do not manage it for applications any more.
author Thinker K.F. Li <thinker@branda.to>
date Sun, 08 Mar 2009 22:24:54 +0800
parents 43900cae1d49
children 3e84458968ec
comparison
equal deleted inserted replaced
347:b247beaac4f0 348:04d22dc38bc0
270 paint_image_t *paint_img = (paint_image_t *)paint; 270 paint_image_t *paint_img = (paint_image_t *)paint;
271 mb_img_data_t *img_data; 271 mb_img_data_t *img_data;
272 272
273 cairo_surface_destroy(paint_img->surf); 273 cairo_surface_destroy(paint_img->surf);
274 img_data = paint_img->img; 274 img_data = paint_img->img;
275 MB_IMG_DATA_FREE(img_data);
276 paint_destroy(&paint_img->paint); 275 paint_destroy(&paint_img->paint);
277 free(paint); 276 free(paint);
278 } 277 }
279 278
280 /*! \brief Create an image painter. 279 /*! \brief Create an image painter.
281 * 280 *
282 * Create a painter that fill/stroke shapes with an image. 281 * Create a painter that fill/stroke shapes with an image.
282 *
283 * \param img is image data return by image load. Life-cycle of img
284 * is managed by application code.
283 */ 285 */
284 paint_t *rdman_paint_image_new(redraw_man_t *rdman, 286 paint_t *rdman_paint_image_new(redraw_man_t *rdman,
285 mb_img_data_t *img) { 287 mb_img_data_t *img) {
286 paint_image_t *paint; 288 paint_image_t *paint;
287 int fmt; 289 int fmt;