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

Ville Syrjälä ville.syrjala at nokia.com
Wed Dec 29 05:29:27 PST 2010


On Wed, Dec 29, 2010 at 01:21:15PM +0000, ext Daniel Stone wrote:
> Hi,
> 
> On Wed, Dec 29, 2010 at 03:04:29PM +0200, ville.syrjala at nokia.com wrote:
> >  static void
> > -compScreenUpdate (ScreenPtr pScreen)
> > +compChildrenUpdate (WindowPtr pWin)
> >  {
> > -    CompScreenPtr   cs = GetCompScreen (pScreen);
> > +    ScreenPtr pScreen = pWin->drawable.pScreen;
> > +    CompScreenPtr cs = GetCompScreen (pScreen);
> >  
> >      compCheckTree (pScreen);
> > -    if (cs->damaged)
> > -    {
> > -	compWindowUpdate (pScreen->root);
> > -	cs->damaged = FALSE;
> > +    if (cs->damaged) {
> > +	WindowPtr pChild;
> > +
> > +	for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib)
> > +	    compWindowUpdate (pChild);
> > +
> > +	if (pWin == pScreen->root)
> > +	    cs->damaged = FALSE;
> 
> compWindowUpdate walks all the children itself, so you should be able to
> replace the for loop with a simple compWindowUpdate(pWin).

compWindowUpdate would cause pWin contents to be copied to it's parent.
That'd be unnecessary work at this point.

-- 
Ville Syrjälä


More information about the xorg-devel mailing list