forked from enlightenment/efl
From: Rajeev Ranjan <rajeev.r@samsung.com>
Subject: [E-devel] [PATCH][EDJE] Patch to remove the alpha from image header while saving if the alpha is set to 1 but the image is fully opaque Attached to the mail is a patch to set the alpha information for an image header to 0 with alpha present but all the texels being opaque. Continuing to our discussion, as suggested by many people in the community it has been implemented at edje_cc level. Change description: While compiling the edc file, image data for image files is scanned to find out whether the alpha value in header is set to 1 and is not being used in the image. If this is the case, while writing to eet the alpha is set to 0 to avoid blending for such images in the graphics pipeline when used by evas. SVN revision: 70954
This commit is contained in:
parent
262e8118b7
commit
f146ce307a
|
@ -23,3 +23,4 @@ Prince Kumar Dubey <prince.dubey@samsung.com> <prince.dubey@gmail.com>
|
|||
David Seikel <onefang at gmail.com>
|
||||
Mikael Sans <sans.mikael@gmail.com>
|
||||
Jérôme Pinot <ngc891@gmail.com>
|
||||
Rajeev Ranjan (Rajeev) <rajeev.r@samsung.com> <rajeev.jnnce@gmail.com>
|
||||
|
|
|
@ -438,3 +438,10 @@
|
|||
2012-05-10 Cedric Bail
|
||||
|
||||
* Preserve user box and table items during call of edje_object_file_set.
|
||||
|
||||
2012-04-30 Rajeev Ranjan (Rajeev)
|
||||
|
||||
* Add edje_cc optimization to remove alpha channel flag from images
|
||||
with absolutely no alpha in them if marked as havin alpha in the
|
||||
originals
|
||||
|
||||
|
|
|
@ -566,6 +566,8 @@ data_write_images(Eet_File *ef, int *image_num, int *input_bytes, int *input_raw
|
|||
int im_w, im_h;
|
||||
int im_alpha;
|
||||
char buf[256];
|
||||
unsigned int *start, *end;
|
||||
Eina_Bool opaque = EINA_TRUE;
|
||||
|
||||
evas_object_image_size_get(im, &im_w, &im_h);
|
||||
im_alpha = evas_object_image_alpha_get(im);
|
||||
|
@ -605,6 +607,21 @@ data_write_images(Eet_File *ef, int *image_num, int *input_bytes, int *input_raw
|
|||
if (qual < min_quality) qual = min_quality;
|
||||
if (qual > max_quality) qual = max_quality;
|
||||
}
|
||||
if (im_alpha)
|
||||
{
|
||||
start = (unsigned int *) im_data;
|
||||
end = start + (im_w * im_h);
|
||||
while (start < end)
|
||||
{
|
||||
if ((*start & 0xff000000) != 0xff000000)
|
||||
{
|
||||
opaque = EINA_FALSE;
|
||||
break;
|
||||
}
|
||||
start++;
|
||||
}
|
||||
if (opaque) im_alpha = 0;
|
||||
}
|
||||
if (mode == 0)
|
||||
bytes = eet_data_image_write(ef, buf,
|
||||
im_data, im_w, im_h,
|
||||
|
|
Loading…
Reference in New Issue