summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2010-01-16 10:31:22 -0500
committerSøren Sandmann Pedersen <sandmann@redhat.com>2010-01-16 14:23:21 -0500
commit29a2bb9f5274bfa265b7c7891e1ca7ddfb405ba2 (patch)
treecce6155738d2c163dd40d7c1c37ada98c3f6321d
parent24726ef4b15375936da4d591b6e23863a3e6bb7b (diff)
When fetching from an alpha map, replace the alpha channel of the imagealpha-fixes
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.
-rw-r--r--pixman/pixman-bits-image.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index fb1af922..a3bcd693 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -120,7 +120,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;
}