[metacity/gnome-3-18] iconcache: Fix apply_mask



commit e2ee54b388d9c3e7eaee45b07609b1e586159db6
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Feb 28 03:41:08 2011 -0500

    iconcache: Fix apply_mask
    
    apply_mask made some wrong assumptions that became untrue
    after rendering_cleanup landed, such as the number of channels
    in the pixmap, causing corruption.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=641975

 src/core/iconcache.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/src/core/iconcache.c b/src/core/iconcache.c
index f8ee61e..2978d4d 100644
--- a/src/core/iconcache.c
+++ b/src/core/iconcache.c
@@ -350,16 +350,10 @@ apply_mask (GdkPixbuf *pixbuf,
       j = 0;
       while (j < w)
         {
-          guchar *s = src + i * src_stride + j * 3;
+          guchar *s = src + i * src_stride + j * 4;
           guchar *d = dest + i * dest_stride + j * 4;
 
-          /* s[0] == s[1] == s[2], they are 255 if the bit was set, 0
-           * otherwise
-           */
-          if (s[0] == 0)
-            d[3] = 0;   /* transparent */
-          else
-            d[3] = 255; /* opaque */
+          d[3] = s[3];
 
           ++j;
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]