Enlightenment CVS committal Author : cedric Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/modules/loaders/xpm Modified Files: evas_image_load_xpm.c Log Message: * Make RGBA_IMAGE_HAS_ALPHA and RGBA_IMAGE_ALPHA_SPARSE part of Image_Entry flag structure. This fix a bug with 16 bpp software engine. * Change image loader module API to take any Image_Entry. Same goes for evas_common_image_premul and evas_common_image_set_alpha_sparse. * Use new eet API: eet_data_image_read_to_surface. =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/loaders/xpm/evas_image_load_xpm.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- evas_image_load_xpm.c 12 Apr 2008 00:32:30 -0000 1.14 +++ evas_image_load_xpm.c 3 Jun 2008 09:09:39 -0000 1.15 @@ -1,8 +1,8 @@ #include "evas_common.h" #include "evas_private.h" -int evas_image_load_file_head_xpm(RGBA_Image *im, const char *file, const char *key); -int evas_image_load_file_data_xpm(RGBA_Image *im, const char *file, const char *key); +int evas_image_load_file_head_xpm(Image_Entry *ie, const char *file, const char *key); +int evas_image_load_file_data_xpm(Image_Entry *ie, const char *file, const char *key); Evas_Image_Load_Func evas_image_load_xpm_func = { @@ -96,7 +96,7 @@ /** FIXME: clean this up and make more efficient **/ static int -evas_image_load_file_xpm(RGBA_Image *im, const char *file, const char *key, int load_data) +evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key, int load_data) { DATA32 *ptr, *end; FILE *f; @@ -249,8 +249,8 @@ return 0; } } - im->cache_entry.w = w; - im->cache_entry.h = h; + ie->w = w; + ie->h = h; j = 0; context++; @@ -360,12 +360,13 @@ context++; } - if (transp) im->flags |= RGBA_IMAGE_HAS_ALPHA; + if (transp) ie->flags.alpha = 1; if (load_data) { - evas_cache_image_surface_alloc(&im->cache_entry, w, h); - if (!im->image.data) + evas_cache_image_surface_alloc(ie, w, h); + ptr = evas_cache_image_pixels(ie); + if (!ptr) { free(cmap); free(line); @@ -373,7 +374,6 @@ xpm_parse_done(); return 0; } - ptr = im->image.data; end = ptr + (w * h); pixels = w * h; } @@ -594,7 +594,7 @@ if (!tl) break; line = tl; } - if (((ptr) && ((ptr - im->image.data) >= (w * h * sizeof(DATA32)))) || + if (((ptr) && ((ptr - evas_cache_image_pixels(ie)) >= (w * h * sizeof(DATA32)))) || ((context > 1) && (count >= pixels))) break; } @@ -610,15 +610,15 @@ int -evas_image_load_file_head_xpm(RGBA_Image *im, const char *file, const char *key) +evas_image_load_file_head_xpm(Image_Entry *ie, const char *file, const char *key) { - return evas_image_load_file_xpm(im, file, key, 0); + return evas_image_load_file_xpm(ie, file, key, 0); } int -evas_image_load_file_data_xpm(RGBA_Image *im, const char *file, const char *key) +evas_image_load_file_data_xpm(Image_Entry *ie, const char *file, const char *key) { - return evas_image_load_file_xpm(im, file, key, 1); + return evas_image_load_file_xpm(ie, file, key, 1); } ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs