[Xorg-driver-geode] [PATCH 3/3] Fix the PictOpSrc rendering

Huang, FrankR FrankR.Huang at amd.com
Sun Jul 4 21:33:56 PDT 2010


From: Frank Huang <frankr.huang at amd.com>

*Add the maskrepeat variable to record mask picture's repeat attribute
*Use the PictOpClear to make other non-blending region to be black
if the op is PictOpSrc
*Use exaScratch.repeat and exaScratch.maskrepeat together instead of
exaScratch.repeat when mask is not zero

Signed-off-by: Frank Huang <frankr.huang at amd.com>
---
 src/lx_exa.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/lx_exa.c b/src/lx_exa.c
index fbb62a0..d13071f 100644
--- a/src/lx_exa.c
+++ b/src/lx_exa.c
@@ -88,6 +88,7 @@ static struct
     unsigned int srcColor;
     int op;
     int repeat;
+    int maskrepeat;
     unsigned int fourBpp;
     unsigned int bufferOffset;
     struct exa_format_t *srcFormat;
@@ -686,6 +687,7 @@ lx_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMsk,
 	/* Save off the info we need (reuse the source values to save space) */
 
 	exaScratch.type = COMP_TYPE_MASK;
+	exaScratch.maskrepeat = pMsk->repeat;
 
 	exaScratch.srcOffset = exaGetPixmapOffset(pxMsk);
 	exaScratch.srcPitch = exaGetPixmapPitch(pxMsk);
@@ -1025,7 +1027,8 @@ lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, int maskX,
     /* When mask exists, exaScratch.srcWidth and exaScratch.srcHeight are
      * the source width and source height; Otherwise, they are mask width
      * and mask height */
-    /* exaScratch.repeat is the source repeat attribute */
+    /* exaScratch.repeat is the source repeat attribute
+     * exaScratch.maskrepeat is the mask repeat attribute */
     /* If type is COMP_TYPE_MASK, maskX and maskY are not zero, we should
      * minus them to do the opeartion in the correct region */
 
@@ -1079,9 +1082,6 @@ lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, int maskX,
 	    break;
 	}
 
-	if (!exaScratch.repeat)
-	    break;
-
 	opX += opWidth;
 
 	if (opX >= dstX + width) {
@@ -1097,11 +1097,24 @@ lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, int maskX,
 		? (exaScratch.srcWidth - maskX) : (dstX + width) - opX;
 	    opHeight = ((dstY + height) - opY) > (exaScratch.srcHeight - maskY)
 		? (exaScratch.srcHeight - maskY) : (dstY + height) - opY;
+	    if ((!exaScratch.maskrepeat) && ((exaScratch.op == PictOpSrc) ||
+		(exaScratch.op == PictOpClear))) {
+		exaScratch.type = COMP_TYPE_ONEPASS;
+		exaScratch.op = PictOpClear;
+	    } else
+		break;
 	} else {
 	    opWidth = ((dstX + width) - opX) > exaScratch.srcWidth ?
 		exaScratch.srcWidth : (dstX + width) - opX;
 	    opHeight = ((dstY + height) - opY) > exaScratch.srcHeight ?
 		exaScratch.srcHeight : (dstY + height) - opY;
+	    if (!(exaScratch.repeat) && (exaScratch.type != COMP_TYPE_ROTATE) &&
+		((exaScratch.op == PictOpSrc) || (exaScratch.op == PictOpClear))
+		&& (exaScratch.type != COMP_TYPE_ROTATE)) {
+		exaScratch.type = COMP_TYPE_ONEPASS;
+		exaScratch.op = PictOpClear;
+	    } else
+		break;
 	}
     }
 }
-- 
1.7.1




More information about the Xorg-driver-geode mailing list