From 27fb8378fdae930475cf4528c539a78bfbd751c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Fri, 7 Aug 2009 10:54:16 -0400 Subject: [PATCH] Fix bug in vmx_combine_xor_ca() The destination needs to be inverted before the alpha channel is extracted; otherwise, the RGB channels of da will be 0xff. --- pixman/pixman-vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c index 7d947d1..5978a07 100644 --- a/pixman/pixman-vmx.c +++ b/pixman/pixman-vmx.c @@ -1542,11 +1542,11 @@ vmx_combine_xor_ca (pixman_implementation_t *imp, uint32_t s = src[i]; uint32_t d = dest[i]; uint32_t sa = ALPHA_8 (s); - uint32_t da = ALPHA_8 (d); + uint32_t da = ALPHA_8 (~d); UN8x4_MUL_UN8x4 (s, a); UN8x4_MUL_UN8 (a, sa); - UN8x4_MUL_UN8x4_ADD_UN8x4_MUL_UN8 (d, ~a, s, ~da); + UN8x4_MUL_UN8x4_ADD_UN8x4_MUL_UN8 (d, ~a, s, da); dest[i] = d; } } -- 2.7.4