pixman: Branch '0.16' - 3 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Mon Feb 8 08:20:08 PST 2010


 pixman/pixman-bits-image.c |    5 +++--
 pixman/pixman-image.c      |    3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit c3683e8148878aedfaf96f72281cbfba38cb5463
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Sat Jan 16 10:31:22 2010 -0500

    When fetching from an alpha map, replace the alpha channel of the image
    
    Previously it would be multiplied onto the image pixel, but the Render
    specification is pretty clear that the alpha map should be used
    *instead* of any alpha channel within the image.
    
    This makes the assumption that the pixels in the image are already
    premultiplied with the alpha channel from the alpha map. If we don't
    make this assumption and the image has an alpha channel of its own, we
    would have to first unpremultiply that pixel, and then premultiply the
    alpha value onto the color channels, and then replace the alpha
    channel.

diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index d079755..7a19109 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -118,7 +118,8 @@ bits_image_fetch_pixel_alpha (bits_image_t *image, int x, int y)
 	pixel_a = ALPHA_8 (pixel_a);
     }
 
-    UN8x4_MUL_UN8 (pixel, pixel_a);
+    pixel &= 0x00ffffff;
+    pixel |= (pixel_a << 24);
 
     return pixel;
 }
commit ca9e2b4c3d12304e6a3edae73687030610e709ed
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Sat Jan 16 10:09:25 2010 -0500

    pixman_image_validate() needs to also validate the alpha map.
    
    This is the other half of bug 25950.

diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index bba5fd6..fff0497 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -247,6 +247,9 @@ _pixman_image_validate (pixman_image_t *image)
 	image->common.property_changed (image);
 	image->common.dirty = FALSE;
     }
+
+    if (image->common.alpha_map)
+	_pixman_image_validate (image->common.alpha_map);
 }
 
 PIXMAN_EXPORT pixman_bool_t
commit fb52113ab8fe88a9178c1f9d26c6ea7e1771d0f1
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Sat Jan 16 10:07:48 2010 -0500

    When fetching from an alpha map, use the alpha map's fetch function.
    
    Don't use the one from the image. This is the first half of bug 25950.

diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index 4e78ce1..d079755 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -113,7 +113,7 @@ bits_image_fetch_pixel_alpha (bits_image_t *image, int x, int y)
     }
     else
     {
-	pixel_a = image->fetch_pixel_raw_32 (
+	pixel_a = image->common.alpha_map->fetch_pixel_raw_32 (
 	    image->common.alpha_map, x, y);
 	pixel_a = ALPHA_8 (pixel_a);
     }


More information about the xorg-commit mailing list