*With the PictOpOver and no Mask condition, when the srcX or SrcY
is greater than the source's picture, do the right rendering. When
the source has repeat attribute, do the PictOpOver; otherwise, do
none-op operation.

Signed-off-by: Frank Huang <[email protected]>
---
 src/lx_exa.c |   35 +++++++++++++++++++++++++++--------
 1 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/src/lx_exa.c b/src/lx_exa.c
index 64c8b40..a510d70 100644
--- a/src/lx_exa.c
+++ b/src/lx_exa.c
@@ -1005,6 +1005,7 @@ lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, int 
maskX,
     unsigned int dstOffset, srcOffset = 0;
 
     int maskflag = 0;
+    int nothing = 0;
 
     xPointFixed srcPoint;
 
@@ -1084,14 +1085,27 @@ lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, 
int maskX,
        if ((exaScratch.srcHeight - maskY) < opHeight)
            opHeight = exaScratch.srcHeight - maskY;
     } else {
-       if (exaScratch.srcWidth < opWidth)
-           opWidth = exaScratch.srcWidth;
-       if (exaScratch.srcHeight < opHeight)
-           opHeight = exaScratch.srcHeight;
+       if (((exaScratch.srcWidth < srcX) || (exaScratch.srcHeight < srcY))
+           && (exaScratch.op == PictOpOver)) {
+           if (exaScratch.repeat == 1) {
+               opWidth = exaScratch.srcWidth;
+               opHeight = exaScratch.srcHeight;
+               srcOffset = GetSrcOffset(0, 0);
+           } else
+               nothing = 1;
+       } else {
+           if ((exaScratch.srcWidth - srcX) < opWidth)
+               opWidth = exaScratch.srcWidth - srcX;
+           if ((exaScratch.srcHeight - srcY) < opHeight)
+               opHeight = exaScratch.srcHeight -srcY;
+       }
     }
 
     while (1) {
 
+       if (nothing == 1)
+           break;
+
        dstOffset = GetPixmapOffset(pxDst, opX, opY);
 
        switch (exaScratch.type) {
@@ -1162,10 +1176,15 @@ lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, 
int maskX,
                (exaScratch.op == PictOpOver))
                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.srcWidth < srcX) || (exaScratch.srcHeight < srcY))
+               &&(exaScratch.op == PictOpOver) && (exaScratch.repeat == 1))
+               break;
+           else {
+               opWidth = ((dstX + width) - opX) > (exaScratch.srcWidth - srcX)
+                   ? (exaScratch.srcWidth - srcX) : (dstX + width) - opX;
+               opHeight = ((dstY + height) - opY) > (exaScratch.srcHeight 
-srcY)
+                   ? (exaScratch.srcHeight - srcY) : (dstY + height) - opY;
+           }
            if ((!exaScratch.repeat) && (exaScratch.op == PictOpSrc)) {
                exaScratch.type = COMP_TYPE_ONEPASS;
                exaScratch.op = PictOpClear;
-- 
1.7.1


_______________________________________________
Xorg-driver-geode mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-driver-geode

Reply via email to