summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-04-09 09:36:41 +0200
committerMichel Dänzer <daenzer@vmware.com>2009-04-09 09:36:41 +0200
commit346e71525fc545c6ca4ad79425722282d1544459 (patch)
tree0af59f681ac82132c2fe6908cb3f05656c6ffe1c /exa
parent682d7b55699cacbb2dbcd84a5e816bf6e2d2f02a (diff)
EXA: If the driver can't composite to an a8 mask, try an argb mask for glyphs.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Diffstat (limited to 'exa')
-rw-r--r--exa/exa_glyphs.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c
index 596b60c6e..d2a0168b4 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);