summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2010-04-07 19:34:41 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2010-04-13 22:41:48 -0400
commita652d5c15476cb60e1ca96ac115df625f8a1b76f (patch)
treebd0ef09fca1b2a718ea544a76bb9dc38a951ced7
parent714559dccda3165a72f0a9935c1edc3aef535f30 (diff)
[mmx] Fix mask creation bugs
This line: mask = mask | mask >> 8 | mask >> 16 | mask >> 24; only works when mask has 0s in the lower 24 bits, so add mask &= 0xff000000; before. Reported by Todd Rinaldo on the #cairo IRC channel.
-rw-r--r--pixman/pixman-mmx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index e084e7ff..d51b40cc 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -1385,6 +1385,7 @@ mmx_composite_over_8888_n_8888 (pixman_implementation_t *imp,
PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, uint32_t, src_stride, src_line, 1);
mask = _pixman_image_get_solid (mask_image, dst_image->bits.format);
+ mask &= 0xff000000;
mask = mask | mask >> 8 | mask >> 16 | mask >> 24;
vmask = load8888 (mask);
srca = MC (4x00ff);
@@ -1470,6 +1471,7 @@ mmx_composite_over_x888_n_8888 (pixman_implementation_t *imp,
PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, uint32_t, src_stride, src_line, 1);
mask = _pixman_image_get_solid (mask_image, dst_image->bits.format);
+ mask &= 0xff000000;
mask = mask | mask >> 8 | mask >> 16 | mask >> 24;
vmask = load8888 (mask);
srca = MC (4x00ff);