commit 87d3058bc13b34673704ae59a58a5ecb09ad7069 Author: Michel Dänzer Date: Tue Mar 24 20:54:44 2009 +0100 EXA: If the driver can't composite to an a8 mask, try an argb mask for glyphs. Signed-off-by: Michel Dänzer diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c index ae5ce1e..9eff14c 100644 --- a/exa/exa_glyphs.c +++ b/exa/exa_glyphs.c @@ -714,6 +714,7 @@ exaGlyphs (CARD8 op, if (maskFormat) { + ExaScreenPriv(pScreen); GCPtr pGC; xRectangle rect; @@ -740,10 +741,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, pMask, pDst))) { + 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);