From f227fbf74f0c619ecf3275cdb4c10b1a4b3a8cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 19 Aug 2008 11:36:12 +0200 Subject: [PATCH] EXA: Inline Prepare/FinishAccessWindow into only caller, ChangeWindowAttributes. Also check the requested mask in addition to the GC state before doing work. --- exa/exa.c | 35 +++++++++++++---------------------- exa/exa_priv.h | 6 ------ 2 files changed, 13 insertions(+), 28 deletions(-) diff --git a/exa/exa.c b/exa/exa.c index 37a0bb055..ab7aab330 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -671,34 +671,25 @@ exaCreateGC (GCPtr pGC) return TRUE; } -void -exaPrepareAccessWindow(WindowPtr pWin) -{ - if (pWin->backgroundState == BackgroundPixmap) - exaPrepareAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); - - if (pWin->borderIsPixel == FALSE) - exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC); -} - -void -exaFinishAccessWindow(WindowPtr pWin) -{ - if (pWin->backgroundState == BackgroundPixmap) - exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); - - if (pWin->borderIsPixel == FALSE) - exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC); -} - static Bool exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask) { Bool ret; - exaPrepareAccessWindow(pWin); + if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap) + exaPrepareAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); + + if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE) + exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK); + ret = fbChangeWindowAttributes(pWin, mask); - exaFinishAccessWindow(pWin); + + if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE) + exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK); + + if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap) + exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); + return ret; } diff --git a/exa/exa_priv.h b/exa/exa_priv.h index 9ec2a560c..dc6a6e07c 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -260,12 +260,6 @@ typedef struct { */ void exaDDXDriverInit (ScreenPtr pScreen); -void -exaPrepareAccessWindow(WindowPtr pWin); - -void -exaFinishAccessWindow(WindowPtr pWin); - /* exa_unaccel.c */ void exaPrepareAccessGC(GCPtr pGC);