xserver: Branch 'master'

Michel Dänzer daenzer at kemper.freedesktop.org
Thu Apr 9 00:37:23 PDT 2009


 exa/exa_glyphs.c |   33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

New commits:
commit 346e71525fc545c6ca4ad79425722282d1544459
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Thu Apr 9 09:36:41 2009 +0200

    EXA: If the driver can't composite to an a8 mask, try an argb mask for glyphs.
    
    Signed-off-by: Michel Dänzer <daenzer at vmware.com>

diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c
index 596b60c..d2a0168 100644
--- a/exa/exa_glyphs.c
+++ b/exa/exa_glyphs.c
@@ -713,6 +713,7 @@ exaGlyphs (CARD8 	 op,
 
     if (maskFormat)
     {
+	ExaScreenPriv(pScreen);
 	GCPtr	    pGC;
 	xRectangle  rect;
 
@@ -739,10 +740,38 @@ exaGlyphs (CARD8 	 op,
 	pMask = CreatePicture (0, &pMaskPixmap->drawable,
 			       maskFormat, CPComponentAlpha, &component_alpha,
 			       serverClient, &error);
-	if (!pMask)
+	if (!pMask ||
+	    (!component_alpha && pExaScr->info->CheckComposite &&
+	     !(*pExaScr->info->CheckComposite) (PictOpAdd, pSrc, NULL, pMask)))
 	{
+	    PictFormatPtr argbFormat;
+
 	    (*pScreen->DestroyPixmap) (pMaskPixmap);
-	    return;
+
+	    if (!pMask)
+		return;
+
+	    /* The driver can't seem to composite to a8, let's try argb (but
+	     * without component-alpha) */
+	    FreePicture ((pointer) pMask, (XID) 0);
+
+	    argbFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
+
+	    if (argbFormat)
+		maskFormat = argbFormat;
+	    
+	    pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
+						    maskFormat->depth,
+						    CREATE_PIXMAP_USAGE_SCRATCH);
+	    if (!pMaskPixmap)
+		return;
+
+	    pMask = CreatePicture (0, &pMaskPixmap->drawable, maskFormat, 0, 0,
+				   serverClient, &error);
+	    if (!pMask) {
+		(*pScreen->DestroyPixmap) (pMaskPixmap);
+		return;
+	    }
 	}
 	pGC = GetScratchGC (pMaskPixmap->drawable.depth, pScreen);
 	ValidateGC (&pMaskPixmap->drawable, pGC);


More information about the xorg-commit mailing list