summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2008-08-19 11:36:12 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2008-08-19 11:36:12 +0200
commitf227fbf74f0c619ecf3275cdb4c10b1a4b3a8cfc (patch)
tree69a011c37954a9d19986ba9233d1d4c6bbf8e7c7
parent825b3fe11d1b813bf8d5b24a880ed04b78ae1acf (diff)
EXA: Inline Prepare/FinishAccessWindow into only caller, ChangeWindowAttributes.
Also check the requested mask in addition to the GC state before doing work.
-rw-r--r--exa/exa.c33
-rw-r--r--exa/exa_priv.h6
2 files changed, 12 insertions, 27 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)
+static Bool
+exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
{
- if (pWin->backgroundState == BackgroundPixmap)
+ Bool ret;
+
+ if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap)
exaPrepareAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC);
- if (pWin->borderIsPixel == FALSE)
- exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC);
-}
+ if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE)
+ exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK);
-void
-exaFinishAccessWindow(WindowPtr pWin)
-{
- if (pWin->backgroundState == BackgroundPixmap)
- exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC);
+ ret = fbChangeWindowAttributes(pWin, mask);
- if (pWin->borderIsPixel == FALSE)
- exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC);
-}
+ if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE)
+ exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK);
-static Bool
-exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
-{
- Bool ret;
+ if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap)
+ exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC);
- exaPrepareAccessWindow(pWin);
- ret = fbChangeWindowAttributes(pWin, mask);
- exaFinishAccessWindow(pWin);
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);