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
This commit is contained in:
parent
e3ebcc004d
commit
92663c81f5
@ -352,16 +352,10 @@ apply_mask (GdkPixbuf *pixbuf,
|
|||||||
j = 0;
|
j = 0;
|
||||||
while (j < w)
|
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;
|
guchar *d = dest + i * dest_stride + j * 4;
|
||||||
|
|
||||||
/* s[0] == s[1] == s[2], they are 255 if the bit was set, 0
|
d[3] = s[3];
|
||||||
* otherwise
|
|
||||||
*/
|
|
||||||
if (s[0] == 0)
|
|
||||||
d[3] = 0; /* transparent */
|
|
||||||
else
|
|
||||||
d[3] = 255; /* opaque */
|
|
||||||
|
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user