summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2010-09-08 16:08:24 -0400
committerKeith Packard <keithp@keithp.com>2010-09-10 11:56:57 -0700
commit648c8871c92727d7b6b16859f27f12266a06a16e (patch)
treebc6ed746c78808aee60699c517e9ecfe8d45fa61
parentbbffb85461eb63bfb1e01e2cb9674607b9221604 (diff)
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>
-rw-r--r--composite/compwindow.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/composite/compwindow.c b/composite/compwindow.c
index 160b7644f..8849dc317 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -639,10 +639,9 @@ compWindowFormat (WindowPtr pWin)
}
static void
-compWindowUpdateAutomatic (WindowPtr pWin)
+compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen)
{
CompWindowPtr cw = GetCompWindow (pWin);
- ScreenPtr pScreen = pWin->drawable.pScreen;
WindowPtr pParent = pWin->parent;
PixmapPtr pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin);
PictFormatPtr pSrcFormat = compWindowFormat (pWin);
@@ -665,8 +664,7 @@ compWindowUpdateAutomatic (WindowPtr pWin)
/*
* First move the region from window to screen coordinates
*/
- RegionTranslate(pRegion,
- pWin->drawable.x, pWin->drawable.y);
+ RegionTranslate(pRegion, pWin->drawable.x, pWin->drawable.y);
/*
* Clip against the "real" border clip
@@ -676,8 +674,7 @@ compWindowUpdateAutomatic (WindowPtr pWin)
/*
* Now translate from screen to dest coordinates
*/
- RegionTranslate(pRegion,
- -pParent->drawable.x, -pParent->drawable.y);
+ RegionTranslate(pRegion, -pParent->drawable.x, -pParent->drawable.y);
/*
* Clip the picture
@@ -706,23 +703,26 @@ compWindowUpdateAutomatic (WindowPtr pWin)
DamageEmpty (cw->damage);
}
-void
-compWindowUpdate (WindowPtr pWin)
+static int
+compWindowUpdateVisit(WindowPtr pWin, void *data)
{
- WindowPtr pChild;
-
- for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib)
- compWindowUpdate (pChild);
if (pWin->redirectDraw != RedirectDrawNone)
{
- CompWindowPtr cw = GetCompWindow(pWin);
-
+ CompWindowPtr cw = GetCompWindow(pWin);
if (cw->damaged)
{
- compWindowUpdateAutomatic (pWin);
+ compWindowUpdateAutomatic(pWin, data);
cw->damaged = FALSE;
}
}
+
+ return WT_WALKCHILDREN;
+}
+
+void
+compWindowUpdate (WindowPtr pWin)
+{
+ TraverseTree(pWin, compWindowUpdateVisit, pWin->drawable.pScreen);
}
WindowPtr