summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajeev Ranjan <rajeev.r@samsung.com>2012-05-13 04:24:28 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-05-13 04:24:28 +0000
commitf146ce307a298878e8a67d404f2bdddc5dcaf804 (patch)
tree8acb4e753d1988555c28916a968855182ecf0a09
parent262e8118b76274565d53622c075a6048ffad4453 (diff)
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
-rw-r--r--legacy/edje/AUTHORS1
-rw-r--r--legacy/edje/ChangeLog7
-rw-r--r--legacy/edje/src/bin/edje_cc_out.c17
3 files changed, 25 insertions, 0 deletions
diff --git a/legacy/edje/AUTHORS b/legacy/edje/AUTHORS
index 3377d78d0c..34ce0fa31f 100644
--- a/legacy/edje/AUTHORS
+++ b/legacy/edje/AUTHORS
@@ -23,3 +23,4 @@ Prince Kumar Dubey <prince.dubey@samsung.com> <prince.dubey@gmail.com>
23David Seikel <onefang at gmail.com> 23David Seikel <onefang at gmail.com>
24Mikael Sans <sans.mikael@gmail.com> 24Mikael Sans <sans.mikael@gmail.com>
25Jérôme Pinot <ngc891@gmail.com> 25Jérôme Pinot <ngc891@gmail.com>
26Rajeev Ranjan (Rajeev) <rajeev.r@samsung.com> <rajeev.jnnce@gmail.com>
diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog
index 59e6842b22..5fc6a4d3d6 100644
--- a/legacy/edje/ChangeLog
+++ b/legacy/edje/ChangeLog
@@ -438,3 +438,10 @@
4382012-05-10 Cedric Bail 4382012-05-10 Cedric Bail
439 439
440 * Preserve user box and table items during call of edje_object_file_set. 440 * Preserve user box and table items during call of edje_object_file_set.
441
4422012-04-30 Rajeev Ranjan (Rajeev)
443
444 * Add edje_cc optimization to remove alpha channel flag from images
445 with absolutely no alpha in them if marked as havin alpha in the
446 originals
447
diff --git a/legacy/edje/src/bin/edje_cc_out.c b/legacy/edje/src/bin/edje_cc_out.c
index f3b4358e32..fe72c5e0c0 100644
--- a/legacy/edje/src/bin/edje_cc_out.c
+++ b/legacy/edje/src/bin/edje_cc_out.c
@@ -566,6 +566,8 @@ data_write_images(Eet_File *ef, int *image_num, int *input_bytes, int *input_raw
566 int im_w, im_h; 566 int im_w, im_h;
567 int im_alpha; 567 int im_alpha;
568 char buf[256]; 568 char buf[256];
569 unsigned int *start, *end;
570 Eina_Bool opaque = EINA_TRUE;
569 571
570 evas_object_image_size_get(im, &im_w, &im_h); 572 evas_object_image_size_get(im, &im_w, &im_h);
571 im_alpha = evas_object_image_alpha_get(im); 573 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
605 if (qual < min_quality) qual = min_quality; 607 if (qual < min_quality) qual = min_quality;
606 if (qual > max_quality) qual = max_quality; 608 if (qual > max_quality) qual = max_quality;
607 } 609 }
610 if (im_alpha)
611 {
612 start = (unsigned int *) im_data;
613 end = start + (im_w * im_h);
614 while (start < end)
615 {
616 if ((*start & 0xff000000) != 0xff000000)
617 {
618 opaque = EINA_FALSE;
619 break;
620 }
621 start++;
622 }
623 if (opaque) im_alpha = 0;
624 }
608 if (mode == 0) 625 if (mode == 0)
609 bytes = eet_data_image_write(ef, buf, 626 bytes = eet_data_image_write(ef, buf,
610 im_data, im_w, im_h, 627 im_data, im_w, im_h,