From d7b7a4e4e78e48b76d9596276ee9a2c1d68c4451 Mon Sep 17 00:00:00 2001
From: Siarhei Siamashka <siarhei.siamashka@nokia.com>
Date: Mon, 20 Apr 2009 16:22:42 +0300
Subject: [PATCH] Fixed rendering bug for source alpha == 0 in OVER fastpath functions

Handling of the case when source alpha is zero was keeping destination
pixel unmodified. But this is different from how generic path behaves.
For example fbOver(0x00200483, 0x9CAC7E9F) == 0x9CCC82FF and the
destination pixel changes from 0x9CAC7E9F to 0x9CCC82FF in spite
of having zero alpha.
---
 pixman/pixman-pict.c |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index 5f3ddd2..46a102e 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -647,7 +647,7 @@ fbCompositeSrc_8888x8888 (pixman_op_t op,
 	    a = s >> 24;
 	    if (a == 0xff)
 		WRITE(pDst, dst, s & dstMask);
-	    else if (a)
+	    else
 		WRITE(pDst, dst, fbOver (s, READ(pDst, dst)) & dstMask);
 	    dst++;
 	}
@@ -739,17 +739,14 @@ fbCompositeSrc_8888x0565 (pixman_op_t op,
 	{
 	    s = READ(pSrc, src++);
 	    a = s >> 24;
-	    if (a)
+	    if (a == 0xff)
+		d = s;
+	    else
 	    {
-		if (a == 0xff)
-		    d = s;
-		else
-		{
-		    d = READ(pDst, dst);
-		    d = fbOver24 (s, cvt0565to0888(d));
-		}
-		WRITE(pDst, dst, cvt8888to0565(d));
+		d = READ(pDst, dst);
+		d = fbOver24 (s, cvt0565to0888(d));
 	    }
+	    WRITE(pDst, dst, cvt8888to0565(d));
 	    dst++;
 	}
     }
-- 
1.5.6.5

