[Xorg-driver-geode] [PATCH 3/5] Add the maskrepeat to record Mask's repeat parameter which is same as Src's repeat

Huang, FrankR FrankR.Huang at amd.com
Fri Jul 2 01:00:04 PDT 2010


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

*Add the maskrepeat variable to record mask picture's repeat attribute
*If the mask is not zero and the maskrepeat equals 0, stop rendering

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

diff --git a/src/lx_exa.c b/src/lx_exa.c
index fbb62a0..9631a8d 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,15 @@ 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)
+		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)
+		break;
 	}
     }
 }
-- 
1.7.1




More information about the Xorg-driver-geode mailing list