From 0dc07cc40f7e3f807cf673ffafa85850ee600090 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Mon, 12 Apr 2010 08:53:11 +0300 Subject: [PATCH] lx_exa: bail earlier (in CheckComposite) for non-alpha-only masks. We should have all the information at CheckComposite already, so don't waste time migrating pixmaps for this case, only to fail in PrepareComposite. Currently more importantly this workarounds EXA fallback failure in xserver-1.7+ for this situation, which resulted in many desktop icons not getting rendered; bug #27243 --- src/lx_exa.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lx_exa.c b/src/lx_exa.c index 31f9b0e..b267cc0 100644 --- a/src/lx_exa.c +++ b/src/lx_exa.c @@ -582,6 +582,12 @@ lx_check_composite(int op, PicturePtr pSrc, PicturePtr pMsk, PicturePtr pDst) if (pSrc->format == PICT_a8 || pDst->format == PICT_a8) return FALSE; + if (pMsk && op != PictOpClear) { + /* We can only do masks with a 8bpp or a 4bpp mask */ + if (pMsk->format != PICT_a8 && pMsk->format != PICT_a4) + return FALSE; + } + return TRUE; } @@ -638,11 +644,6 @@ lx_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMsk, struct blend_ops_t *opPtr = &lx_alpha_ops[op * 2]; int direction = (opPtr->channel == CIMGP_CHANNEL_A_SOURCE) ? 0 : 1; - /* We can only do masks with a 8bpp or a 4bpp mask */ - - if (pMsk->format != PICT_a8 && pMsk->format != PICT_a4) - return FALSE; - /* Direction 0 indicates src->dst, 1 indiates dst->src */ if (((direction == 0) && (pxSrc->drawable.bitsPerPixel < 16)) || -- 1.6.1.3