composite: Convert compWindowUpdate to use TraverseTree

v2: Use != RedirectDrawNone, since we aren't called for manual windows.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Adam Jackson 2010-09-08 16:08:24 -04:00 committed by Keith Packard
parent bbffb85461
commit 648c8871c9

View File

@ -639,10 +639,9 @@ compWindowFormat (WindowPtr pWin)
} }
static void static void
compWindowUpdateAutomatic (WindowPtr pWin) compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen)
{ {
CompWindowPtr cw = GetCompWindow (pWin); CompWindowPtr cw = GetCompWindow (pWin);
ScreenPtr pScreen = pWin->drawable.pScreen;
WindowPtr pParent = pWin->parent; WindowPtr pParent = pWin->parent;
PixmapPtr pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin); PixmapPtr pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin);
PictFormatPtr pSrcFormat = compWindowFormat (pWin); PictFormatPtr pSrcFormat = compWindowFormat (pWin);
@ -665,8 +664,7 @@ compWindowUpdateAutomatic (WindowPtr pWin)
/* /*
* First move the region from window to screen coordinates * First move the region from window to screen coordinates
*/ */
RegionTranslate(pRegion, RegionTranslate(pRegion, pWin->drawable.x, pWin->drawable.y);
pWin->drawable.x, pWin->drawable.y);
/* /*
* Clip against the "real" border clip * Clip against the "real" border clip
@ -676,8 +674,7 @@ compWindowUpdateAutomatic (WindowPtr pWin)
/* /*
* Now translate from screen to dest coordinates * Now translate from screen to dest coordinates
*/ */
RegionTranslate(pRegion, RegionTranslate(pRegion, -pParent->drawable.x, -pParent->drawable.y);
-pParent->drawable.x, -pParent->drawable.y);
/* /*
* Clip the picture * Clip the picture
@ -706,23 +703,26 @@ compWindowUpdateAutomatic (WindowPtr pWin)
DamageEmpty (cw->damage); DamageEmpty (cw->damage);
} }
void static int
compWindowUpdate (WindowPtr pWin) compWindowUpdateVisit(WindowPtr pWin, void *data)
{ {
WindowPtr pChild;
for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib)
compWindowUpdate (pChild);
if (pWin->redirectDraw != RedirectDrawNone) if (pWin->redirectDraw != RedirectDrawNone)
{ {
CompWindowPtr cw = GetCompWindow(pWin); CompWindowPtr cw = GetCompWindow(pWin);
if (cw->damaged) if (cw->damaged)
{ {
compWindowUpdateAutomatic (pWin); compWindowUpdateAutomatic(pWin, data);
cw->damaged = FALSE; cw->damaged = FALSE;
} }
} }
return WT_WALKCHILDREN;
}
void
compWindowUpdate (WindowPtr pWin)
{
TraverseTree(pWin, compWindowUpdateVisit, pWin->drawable.pScreen);
} }
WindowPtr WindowPtr