diff options
author | Ville Syrjälä <ville.syrjala@nokia.com> | 2011-01-05 20:41:09 +0200 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-01-05 11:57:31 -0800 |
commit | f3480286aeb3009623d8d4b0202eadda0049552d (patch) | |
tree | d9e2b9ebbddf60e3640ed322306b1fa82b06f5e3 /composite/compwindow.c | |
parent | b89e6dbdfbb50e3b5bc7fcb7eccc397c467c92f8 (diff) |
composite: Support updating an arbitrary subtree
Rename compUpdateWindow to compPaintWindowToParent and split the child
walk to compPaintChildrenToWindow. Calling compPaintChildrenToWindow
allows an arbitrary subtree to be updated, instead of having to update
all the windows. This will be used to make sure all the descendants are
copied to the parent when the parent window contents need to be accessed
in IncludeInferios sub-window mode.
WindowRec has a new member 'damagedDescendants' that is used to keep
track of which subtrees need updating. When a window is damaged,
'damagedDescendants' will be set for all the ancestors, and when a
subtree is updated, the tree walk can be stopped early if no damaged
descendants are present.
CompScreenRec no longer needs the 'damaged' member since the root
window's 'damagedDescendants' provides the same information.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'composite/compwindow.c')
-rw-r--r-- | composite/compwindow.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/composite/compwindow.c b/composite/compwindow.c index 22d237481..2440f1897 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -720,13 +720,11 @@ compWindowUpdateAutomatic (WindowPtr pWin) DamageEmpty (cw->damage); } -void -compWindowUpdate (WindowPtr pWin) +static void +compPaintWindowToParent (WindowPtr pWin) { - WindowPtr pChild; + compPaintChildrenToWindow (pWin); - for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib) - compWindowUpdate (pChild); if (pWin->redirectDraw != RedirectDrawNone) { CompWindowPtr cw = GetCompWindow(pWin); @@ -739,6 +737,20 @@ compWindowUpdate (WindowPtr pWin) } } +void +compPaintChildrenToWindow (WindowPtr pWin) +{ + WindowPtr pChild; + + if (!pWin->damagedDescendants) + return; + + for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib) + compPaintWindowToParent (pChild); + + pWin->damagedDescendants = FALSE; +} + WindowPtr CompositeRealChildHead (WindowPtr pWin) { |