[PATCH] EXA: Avoid using < 8 bit mask formats for trapezoid/triangle composition.

Michel Dänzer michel at daenzer.net
Mon Dec 28 01:41:28 PST 2009


From: Michel Dänzer <daenzer at vmware.com>

It's more or less impossible for us to accelerate such formats at this point.

Signed-off-by: Michel Dänzer <daenzer at vmware.com>
---
 exa/exa_render.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/exa/exa_render.c b/exa/exa_render.c
index 1b68e1c..d4d4abf 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -1099,10 +1099,7 @@ exaCreateAlphaPicture (ScreenPtr     pScreen,
 
     if (!pPictFormat)
     {
-	if (pDst->polyEdge == PolyEdgeSharp)
-	    pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
-	else
-	    pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
+	pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
 	if (!pPictFormat)
 	    return 0;
     }
@@ -1158,6 +1155,9 @@ exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
 	INT16		xDst, yDst;
 	INT16		xRel, yRel;
 
+	if (maskFormat->depth < 8)
+	    maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
+
 	miTrapezoidBounds (ntrap, traps, &bounds);
 
 	if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
@@ -1186,10 +1186,7 @@ exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
 			  bounds.y2 - bounds.y1);
 	FreePicture (pPicture, 0);
     } else {
-	if (pDst->polyEdge == PolyEdgeSharp)
-	    maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
-	else
-	    maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
+	maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
 	for (; ntrap; ntrap--, traps++)
 	    exaTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps);
     }
@@ -1222,6 +1219,9 @@ exaTriangles (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
 	INT16		xDst, yDst;
 	INT16		xRel, yRel;
 
+	if (maskFormat->depth < 8)
+	    maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
+
 	miTriangleBounds (ntri, tris, &bounds);
 
 	if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
@@ -1247,10 +1247,7 @@ exaTriangles (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
 			  bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
 	FreePicture (pPicture, 0);
     } else {
-	if (pDst->polyEdge == PolyEdgeSharp)
-	    maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
-	else
-	    maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
+	maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
 
 	for (; ntri; ntri--, tris++)
 	    exaTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, tris);
-- 
1.6.5.7



More information about the xorg-devel mailing list