[Xorg-driver-geode] [PATCH 3/6] Fix the PictOpSrc rendering
Huang, FrankR
FrankR.Huang at amd.com
Tue Jun 29 02:18:23 PDT 2010
*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 | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/lx_exa.c b/src/lx_exa.c
index 23a8e07..5bec11d 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;
@@ -684,6 +685,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);
@@ -1023,7 +1025,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 */
@@ -1077,9 +1080,6 @@ lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, int maskX,
break;
}
- if (!exaScratch.repeat)
- break;
-
opX += opWidth;
if (opX >= dstX + width) {
@@ -1095,11 +1095,22 @@ 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;
+ /* For the PictOpSrc operation, we need other region to be black
+ * out of the blend region */
+ if (exaScratch.repeat && (!exaScratch.maskrepeat) &&
+ (exaScratch.op == PictOpSrc)) {
+ exaScratch.type = COMP_TYPE_ONEPASS;
+ exaScratch.op = PictOpClear;
+ }
} 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.op == PictOpSrc)) {
+ exaScratch.type = COMP_TYPE_ONEPASS;
+ exaScratch.op = PictOpClear;
+ }
}
}
}
--
1.7.1
More information about the Xorg-driver-geode
mailing list