From da9f3266fd00a5634fd2fb8a9cffbf24d668aaab Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Fri, 29 May 2009 21:20:20 -0400 Subject: [PATCH] In the mmx implementation, check for source == 0 rather than alpha == 0. Otherwise we compute the incorrect value when the source has zero in the alpha channel, but non-zero in the color channels. --- pixman/pixman-mmx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index 957aed2..db87b19 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c @@ -446,7 +446,7 @@ mmxCombineOverU (pixman_implementation_t *imp, pixman_op_t op, uint32_t a = ssrc >> 24; if (a == 0xff) { *dest = ssrc; - } else if (a) { + } else if (ssrc) { __m64 s, sa; s = load8888(ssrc); sa = expand_alpha(s); @@ -1447,7 +1447,7 @@ fbCompositeSrc_8888x8888mmx (pixman_implementation_t *imp, a = s >> 24; if (a == 0xff) *dst = s; - else if (a) { + else if (s) { __m64 ms, sa; ms = load8888(s); sa = expand_alpha(ms); @@ -2180,7 +2180,7 @@ fbCompositeSrc_8888RevNPx0565mmx (pixman_implementation_t *imp, *(__m64 *)dst = vdest; } - else if (a0 | a1 | a2 | a3) + else if (s0 | s1 | s2 | s3) { __m64 vdest = *(__m64 *)dst; @@ -2289,7 +2289,7 @@ fbCompositeSrc_8888RevNPx8888mmx (pixman_implementation_t *imp, *(__m64 *)dst = pack8888 (d0, d1); } - else if (a0 | a1) + else if (s0 | s1) { __m64 vdest = *(__m64 *)dst; @@ -3064,6 +3064,7 @@ static const FastPathInfo mmx_fast_paths[] = { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeSolid_nx0565mmx, 0 }, { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeCopyAreammx, 0 }, { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeCopyAreammx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeSrc_8888x8888mmx, 0 }, { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeSrc_8888x8888mmx, 0 }, { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeSrc_8888x0565mmx, 0 }, -- 2.7.4