From b432548edeca646d7c0d5973f76283786337370f Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Michel=20D=C3=A4nzer?= Date: Sun, 22 Feb 2009 16:23:05 +0100 Subject: EXA: Handle separate alpha maps in Composite fallback. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 . Signed-off-by: Michel Dänzer --- exa/exa.h | 4 ++++ exa/exa_unaccel.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/exa/exa.h b/exa/exa.h index c48a582..ef7cf1a 100644 --- a/exa/exa.h +++ b/exa/exa.h @@ -674,6 +674,10 @@ typedef struct _ExaDriver { * from. */ #define EXA_PREPARE_MASK 2 + + #define EXA_PREPARE_ALPHAMAP_DEST 3 + #define EXA_PREPARE_ALPHAMAP_SRC 4 + #define EXA_PREPARE_ALPHAMAP_MASK 5 /** @} */ /** diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index 8c9d6bd..22f8f67 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -404,6 +404,7 @@ ExaCheckComposite(ExaScreenPrivPtr pExaScr, CARD8 op, PicturePtr pSrc, #ifdef RENDER PictureScreenPtr ps = GetPictureScreen(pScreen); #endif /* RENDER */ + ExaPixmapPrivPtr pExaDstAlphaPix = NULL, pExaMaskAlphaPix = NULL, pExaSrcAlphaPix = NULL; RegionRec region; int xoff, yoff; @@ -427,15 +428,34 @@ ExaCheckComposite(ExaScreenPrivPtr pExaScr, CARD8 op, PicturePtr pSrc, exaPrepareAccess (pExaScr, pDst->pDrawable, pExaDstPix, EXA_PREPARE_DEST); + if (pDst->alphaMap && pDst->alphaMap->pDrawable) { + pExaDstAlphaPix = + ExaGetPixmapPriv(exaGetDrawablePixmap(pDst->alphaMap->pDrawable)); + exaPrepareAccess(pExaScr, pDst->alphaMap->pDrawable, pExaDstAlphaPix, + EXA_PREPARE_ALPHAMAP_DEST); + } + EXA_FALLBACK(("from picts %p/%p to pict %p\n", pSrc, pMask, pDst)); if (pSrc->pDrawable != NULL) exaPrepareAccess (pExaScr, pSrc->pDrawable, pExaSrcPix, EXA_PREPARE_SRC); + if (pSrc->alphaMap && pSrc->alphaMap->pDrawable) { + pExaSrcAlphaPix = + ExaGetPixmapPriv(exaGetDrawablePixmap(pSrc->alphaMap->pDrawable)); + exaPrepareAccess(pExaScr, pSrc->alphaMap->pDrawable, pExaSrcAlphaPix, + EXA_PREPARE_ALPHAMAP_SRC); + } if (pMask && pMask->pDrawable != NULL) exaPrepareAccess (pExaScr, pMask->pDrawable, pExaMaskPix, EXA_PREPARE_MASK); + if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable) { + pExaMaskAlphaPix = + ExaGetPixmapPriv(exaGetDrawablePixmap(pMask->alphaMap->pDrawable)); + exaPrepareAccess(pExaScr, pMask->alphaMap->pDrawable, pExaMaskAlphaPix, + EXA_PREPARE_ALPHAMAP_MASK); + } #ifdef RENDER swap(pExaScr, ps, Composite); ps->Composite (op, @@ -455,10 +475,19 @@ ExaCheckComposite(ExaScreenPrivPtr pExaScr, CARD8 op, PicturePtr pSrc, if (pMask && pMask->pDrawable != NULL) exaFinishAccess (pExaScr, pMask->pDrawable, pExaMaskPix, EXA_PREPARE_MASK); + if (pExaMaskAlphaPix) + exaFinishAccess(pExaScr, pMask->alphaMap->pDrawable, pExaMaskAlphaPix, + EXA_PREPARE_ALPHAMAP_MASK); if (pSrc->pDrawable != NULL) exaFinishAccess (pExaScr, pSrc->pDrawable, pExaSrcPix, EXA_PREPARE_SRC); + if (pExaSrcAlphaPix) + exaFinishAccess(pExaScr, pSrc->alphaMap->pDrawable, pExaSrcAlphaPix, + EXA_PREPARE_ALPHAMAP_SRC); exaFinishAccess (pExaScr, pDst->pDrawable, pExaDstPix, EXA_PREPARE_DEST); + if (pExaDstAlphaPix) + exaFinishAccess(pExaScr, pDst->alphaMap->pDrawable, pExaDstAlphaPix, + EXA_PREPARE_ALPHAMAP_DEST); REGION_UNINIT(pScreen, ®ion); } -- 1.6.2.rc1