EXA: Inline Prepare/FinishAccessWindow into only caller, ChangeWindowAttributes.

Also check the requested mask in addition to the GC state before doing work.
This commit is contained in:
Michel Dänzer 2008-08-19 11:36:12 +02:00
parent 825b3fe11d
commit f227fbf74f
2 changed files with 13 additions and 28 deletions

View File

@ -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;
}

View File

@ -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);