[PATCH 2/4] composite: Support updating an arbitrary subtree

Ville Syrjälä ville.syrjala at nokia.com
Thu Dec 30 04:56:19 PST 2010


On Wed, Dec 29, 2010 at 01:05:02PM -0800, ext Keith Packard wrote:
> On Wed, 29 Dec 2010 15:04:29 +0200, ville.syrjala at nokia.com wrote:
> > From: Ville Syrjälä <ville.syrjala at nokia.com>
> > 
> > Rename compScreenUpdate to compChildrenUpdate, and pass a window as
> > the parameter. This allows an arbitrary subtree to be updated, instead
> > of having to update all the windows. This will be used to make sure
> > all the children have been updated when the parent window contents need
> > to be accessed in IncludeInferios sub-window mode.
> 
> This change isn't right -- compWindowUpdate is already recursive, so
> there's no need to walk across the children.

I wanted to avoid the copy from pWin to it's parent,

> I'm also (vaguely) concerned about performance here -- because there's
> no per-window hierarchy damage information, you'll be walking the window
> sub-tree on every single operation.
> 
> It seems like a simple change would be to just clean the whole tree on
> any IncludeInferiors operation so that at least a sequence of those
> would only walk the tree once. That would change the code to just call
> compScreenUpdate whenever CompositeUpdateWindow was called.
> 
> A more complicated change would require marking the ancestor chain with
> damage on each rendering operation, stopping when you hit a window that
> is already marked, and cleaning those bits when updating windows.
> However, given that all of this only happens when you have automatic
> redirection going on, it's hard to get that worked up about it.

Right. I was thinking about making cs->damaged into a counter, but that
would still cause needless tree walks if the damaged windows are in a
different subtree. So yeah, marking the ancestors would be the best
choice. I'll take a look at doing that.

-- 
Ville Syrjälä


More information about the xorg-devel mailing list