xserver: Branch 'xorg-server-1.4-apple' - 3 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri Nov 23 13:48:52 PST 2007


 miext/rootless/accel/rlBlt.c                |   44 ++++++++++-
 miext/rootless/accel/rlFill.c               |    6 -
 miext/rootless/rootlessCommon.h             |    4 +
 miext/rootless/safeAlpha/safeAlphaPicture.c |  109 +++++++++++++++-------------
 4 files changed, 108 insertions(+), 55 deletions(-)

New commits:
commit fa5f25482c11ac6ae51e591a1cb7d372e0598a8a
Author: Jeremy Huddleston <jeremy at tifa.local>
Date:   Thu Nov 22 13:53:00 2007 -0800

    Rootless: Imported changes made in xorg-server-1.2-apple branch
    (cherry picked from commit a751bc12bee1d4d2ed35e3a0c64d9c8c9bf30a82)

diff --git a/miext/rootless/safeAlpha/safeAlphaPicture.c b/miext/rootless/safeAlpha/safeAlphaPicture.c
index 0ed2f3e..8f66315 100644
--- a/miext/rootless/safeAlpha/safeAlphaPicture.c
+++ b/miext/rootless/safeAlpha/safeAlphaPicture.c
@@ -46,6 +46,7 @@
 #include "fbpict.h"
 #include "safeAlpha.h"
 #include "rootlessCommon.h"
+# define mod(a,b)	((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
 
 /* Optimized version of fbCompositeSolidMask_nx8x8888 */
 void
@@ -133,68 +134,78 @@ SafeAlphaCompositeSolidMask_nx8x8888(
 
 void
 SafeAlphaComposite (CARD8           op,
-		    PicturePtr      pSrc,
-		    PicturePtr      pMask,
-		    PicturePtr      pDst,
-		    INT16           xSrc,
-		    INT16           ySrc,
-		    INT16           xMask,
-		    INT16           yMask,
-		    INT16           xDst,
-		    INT16           yDst,
-		    CARD16          width,
-		    CARD16          height)
+                    PicturePtr      pSrc,
+                    PicturePtr      pMask,
+                    PicturePtr      pDst,
+                    INT16           xSrc,
+                    INT16           ySrc,
+                    INT16           xMask,
+                    INT16           yMask,
+                    INT16           xDst,
+                    INT16           yDst,
+                    CARD16          width,
+                    CARD16          height)
 {
-    int oldDepth = pDst->pDrawable->depth;
-    int oldFormat = pDst->format;
+  if (!pSrc) {
+    ErrorF("SafeAlphaComposite: pSrc must not be null!\n");
+    return;
+  }
+
+  if (!pDst) {
+    ErrorF("SafeAlphaComposite: pDst must not be null!\n");
+    return;
+  }
+  
+  int oldDepth = pDst->pDrawable->depth;
+  int oldFormat = pDst->format;
     
-    /*
-     * We can use the more optimized fbpict code, but it sets bits above
-     * the depth to zero. Temporarily adjust destination depth if needed.
-     */
-    if (pDst->pDrawable->type == DRAWABLE_WINDOW
-	&& pDst->pDrawable->depth == 24
-	&& pDst->pDrawable->bitsPerPixel == 32)
+  /*
+   * We can use the more optimized fbpict code, but it sets bits above
+   * the depth to zero. Temporarily adjust destination depth if needed.
+   */
+  if (pDst->pDrawable->type == DRAWABLE_WINDOW
+        && pDst->pDrawable->depth == 24
+      && pDst->pDrawable->bitsPerPixel == 32)
     {
-	pDst->pDrawable->depth = 32;
+      pDst->pDrawable->depth = 32;
     }
     
-    /* For rootless preserve the alpha in x8r8g8b8 which really is
-     * a8r8g8b8
-     */
-    if (oldFormat == PICT_x8r8g8b8)
+  /* For rootless preserve the alpha in x8r8g8b8 which really is
+   * a8r8g8b8
+   */
+  if (oldFormat == PICT_x8r8g8b8)
     {
-        pDst->format = PICT_a8r8g8b8;
+      pDst->format = PICT_a8r8g8b8;
     }
     
-    if (pSrc->pDrawable && pMask->pDrawable &&
-	!pSrc->transform && !pMask->transform &&
-	!pSrc->alphaMap && !pMask->alphaMap &&
-	!pMask->repeat && !pMask->componentAlpha && !pDst->alphaMap &&
-	pMask->format == PICT_a8 &&
-	pSrc->repeatType == RepeatNormal && 
-	pSrc->pDrawable->width == 1 &&
-	pSrc->pDrawable->height == 1 &&
-	(pDst->format == PICT_a8r8g8b8 ||
-	 pDst->format == PICT_x8r8g8b8 ||
-	 pDst->format == PICT_a8b8g8r8 ||
-	 pDst->format == PICT_x8b8g8r8))
+  if (pSrc->pDrawable && pMask && pMask->pDrawable &&
+        !pSrc->transform && !pMask->transform &&
+        !pSrc->alphaMap && !pMask->alphaMap &&
+        !pMask->repeat && !pMask->componentAlpha && !pDst->alphaMap &&
+        pMask->format == PICT_a8 &&
+       pSrc->repeatType == RepeatNormal && 
+        pSrc->pDrawable->width == 1 &&
+        pSrc->pDrawable->height == 1 &&
+      (pDst->format == PICT_a8r8g8b8 ||
+         pDst->format == PICT_x8r8g8b8 ||
+         pDst->format == PICT_a8b8g8r8 ||
+       pDst->format == PICT_x8b8g8r8))
     {
-	fbWalkCompositeRegion (op, pSrc, pMask, pDst,
-			       xSrc, ySrc, xMask, yMask, xDst, yDst,
-			       width, height,
-			       TRUE /* srcRepeat */,
-			       FALSE /* maskRepeat */,
-			       SafeAlphaCompositeSolidMask_nx8x8888);
+      fbWalkCompositeRegion (op, pSrc, pMask, pDst,
+			     xSrc, ySrc, xMask, yMask, xDst, yDst,
+			     width, height,
+			     TRUE /* srcRepeat */,
+			     FALSE /* maskRepeat */,
+			     SafeAlphaCompositeSolidMask_nx8x8888);
     }
-    else
+  else
     {
-	fbComposite (op, pSrc, pMask, pDst,
-		     xSrc, ySrc, xMask, yMask, xDst, yDst, width, height);
+      fbComposite (op, pSrc, pMask, pDst,
+		   xSrc, ySrc, xMask, yMask, xDst, yDst, width, height);
     }
 
-    pDst->pDrawable->depth = oldDepth;
-    pDst->format = oldFormat;
+  pDst->pDrawable->depth = oldDepth;
+  pDst->format = oldFormat;
 }
 
 #endif /* RENDER */
commit d045981457062545619df31a7ce4de3e49d328fe
Author: Jeremy Huddleston <jeremy at tifa.local>
Date:   Thu Nov 22 13:55:03 2007 -0800

    Rootless: Added missing includes.
    (cherry picked from commit f6a4c10636268669c889c05bae52a2f8579e7b80)

diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h
index d3f242e..62524b9 100644
--- a/miext/rootless/rootlessCommon.h
+++ b/miext/rootless/rootlessCommon.h
@@ -39,6 +39,10 @@
 #include "rootless.h"
 #include "fb.h"
 
+#ifdef SHAPE
+#include "scrnintstr.h"
+#endif /* SHAPE */
+
 #ifdef RENDER
 #include "picturestr.h"
 #endif
commit b436b1cfbb0d95fefb76374e2dd646dd64c0e4de
Author: Jeremy Huddleston <jeremy at tifa.local>
Date:   Thu Nov 22 12:21:59 2007 -0800

    Rootless: Pulled in changes from fb{Blt,Fill} into rl{Blt,Fill}
    (cherry picked from commit 4e18c626350c7c2e0fb540aa64a98957699f3abe)

diff --git a/miext/rootless/accel/rlBlt.c b/miext/rootless/accel/rlBlt.c
index 2cf72eb..b5fe740 100644
--- a/miext/rootless/accel/rlBlt.c
+++ b/miext/rootless/accel/rlBlt.c
@@ -32,10 +32,22 @@
 #endif
 
 #include <stddef.h> /* For NULL */
+#include <string.h>
 #include "fb.h"
 #include "rootlessCommon.h"
 #include "rlAccel.h"
 
+#define InitializeShifts(sx,dx,ls,rs) { \
+    if (sx != dx) { \
+	if (sx > dx) { \
+	    ls = sx - dx; \
+	    rs = FB_UNIT - ls; \
+	} else { \
+	    rs = dx - sx; \
+	    ls = FB_UNIT - rs; \
+	} \
+    } \
+}
 
 void
 rlBlt (FbBits   *srcLine,
@@ -74,6 +86,29 @@ rlBlt (FbBits   *srcLine,
 	return;
     }
 #endif
+
+    if (alu == GXcopy && pm == FB_ALLONES && !reverse &&
+            !(srcX & 7) && !(dstX & 7) && !(width & 7)) {
+        int i;
+        CARD8 *src = (CARD8 *) srcLine;
+        CARD8 *dst = (CARD8 *) dstLine;
+        
+        srcStride *= sizeof(FbBits);
+        dstStride *= sizeof(FbBits);
+        width >>= 3;
+        src += (srcX >> 3);
+        dst += (dstX >> 3);
+
+        if (!upsidedown)
+            for (i = 0; i < height; i++)
+                memcpy(dst + i * dstStride, src + i * srcStride, width);
+        else
+            for (i = height - 1; i >= 0; i--)
+                memcpy(dst + i * dstStride, src + i * srcStride, width);
+
+        return;
+    }
+
     FbInitializeMergeRop(alu, pm);
     destInvarient = FbDestInvarientMergeRop();
     if (upsidedown)
@@ -325,9 +360,12 @@ rlBlt (FbBits   *srcLine,
 		    bits1 = *src++;
 		if (startmask)
 		{
-		    bits = FbScrLeft(bits1, leftShift);
-		    bits1 = *src++;
-		    bits |= FbScrRight(bits1, rightShift);
+		    bits = FbScrLeft(bits1, leftShift); 
+		    if (FbScrLeft(startmask, rightShift))
+		    {
+			bits1 = *src++;
+			bits |= FbScrRight(bits1, rightShift);
+		    }
 		    FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
 		    dst++;
 		}
diff --git a/miext/rootless/accel/rlFill.c b/miext/rootless/accel/rlFill.c
index 0d0d012..a80c776 100644
--- a/miext/rootless/accel/rlFill.c
+++ b/miext/rootless/accel/rlFill.c
@@ -89,7 +89,7 @@ rlFill (DrawablePtr pDrawable,
 		    dstBpp,
 		    
 		    (pGC->patOrg.x + pDrawable->x + dstXoff),
-		    pGC->patOrg.y + pDrawable->y + dstYoff - y);
+		    pGC->patOrg.y + pDrawable->y - y);
 	}
 	else
 	{
@@ -126,7 +126,7 @@ rlFill (DrawablePtr pDrawable,
 		       fgand, fgxor,
 		       bgand, bgxor,
 		       pGC->patOrg.x + pDrawable->x + dstXoff,
-		       pGC->patOrg.y + pDrawable->y + dstYoff - y);
+		       pGC->patOrg.y + pDrawable->y - y);
 	}
 	break;
     }
@@ -154,7 +154,7 @@ rlFill (DrawablePtr pDrawable,
 		pPriv->pm,
 		dstBpp,
 		(pGC->patOrg.x + pDrawable->x + dstXoff) * dstBpp,
-		pGC->patOrg.y + pDrawable->y + dstYoff - y);
+		pGC->patOrg.y + pDrawable->y - y);
 	break;
     }
     }


More information about the xorg-commit mailing list