Enlightenment CVS committal Author : cedric Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/modules/loaders/edb Modified Files: evas_image_load_edb.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/edb/evas_image_load_edb.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- evas_image_load_edb.c 12 Apr 2008 00:32:29 -0000 1.6 +++ evas_image_load_edb.c 3 Jun 2008 09:09:38 -0000 1.7 @@ -8,8 +8,8 @@ #define SWAP32(x) (x) = ((((x) & 0x000000ff ) << 24) | (((x) & 0x0000ff00 ) << 8) | (((x) & 0x00ff0000 ) >> 8) | (((x) & 0xff000000 ) >> 24)) -int evas_image_load_file_head_edb(RGBA_Image *im, const char *file, const char *key); -int evas_image_load_file_data_edb(RGBA_Image *im, const char *file, const char *key); +int evas_image_load_file_head_edb(Image_Entry *ie, const char *file, const char *key); +int evas_image_load_file_data_edb(Image_Entry *ie, const char *file, const char *key); Evas_Image_Load_Func evas_image_load_edb_func = { @@ -19,7 +19,7 @@ int -evas_image_load_file_head_edb(RGBA_Image *im, const char *file, const char *key) +evas_image_load_file_head_edb(Image_Entry *ie, const char *file, const char *key) { int w, h, alpha, compression, size; E_DB_File *db; @@ -72,21 +72,22 @@ e_db_close(db); return 0; } - if (alpha) im->flags |= RGBA_IMAGE_HAS_ALPHA; - im->cache_entry.w = w; - im->cache_entry.h = h; + if (alpha) ie->flags.alpha = 1; + ie->w = w; + ie->h = h; free(ret); e_db_close(db); return 1; } int -evas_image_load_file_data_edb(RGBA_Image *im, const char *file, const char *key) +evas_image_load_file_data_edb(Image_Entry *ie, const char *file, const char *key) { int w, h, alpha, compression, size; E_DB_File *db; DATA32 *ret; DATA32 *body; + DATA32 *surface; DATA32 header[8]; if ((!file) || (!key)) return 0; @@ -136,10 +137,11 @@ e_db_close(db); return 0; } - if (alpha) im->flags |= RGBA_IMAGE_HAS_ALPHA; + if (alpha) ie->flags.alpha = 1; body = &(ret[8]); - evas_cache_image_surface_alloc(&im->cache_entry, w, h); - if (!im->image.data) + evas_cache_image_surface_alloc(ie, w, h); + surface = evas_cache_image_pixels(ie); + if (!surface) { free(ret); e_db_close(db); @@ -151,11 +153,11 @@ { int x; - memcpy(im->image.data, body, w * h * sizeof(DATA32)); - for (x = 0; x < (w * h); x++) SWAP32(im->image.data[x]); + memcpy(surface, body, w * h * sizeof(DATA32)); + for (x = 0; x < (w * h); x++) SWAP32(surface[x]); } #else - memcpy(im->image.data, body, w * h * sizeof(DATA32)); + memcpy(surface, body, w * h * sizeof(DATA32)); #endif } else @@ -163,17 +165,17 @@ uLongf dlen; dlen = w * h * sizeof(DATA32); - uncompress((Bytef *)im->image.data, &dlen, (Bytef *)body, + uncompress((Bytef *)surface, &dlen, (Bytef *)body, (uLongf)(size - 32)); #ifdef WORDS_BIGENDIAN { int x; - for (x = 0; x < (w * h); x++) SWAP32(im->image.data[x]); + for (x = 0; x < (w * h); x++) SWAP32(surface[x]); } #endif } - evas_common_image_premul(im); + evas_common_image_premul(ie); free(ret); e_db_close(db); return 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