[PATCH v2 4/6] composite: Add SourceValidate wrapper

Ville Syrjälä ville.syrjala at nokia.com
Mon Jan 3 04:27:25 PST 2011


On Fri, Dec 31, 2010 at 01:42:16PM -0800, ext Keith Packard wrote:
> On Fri, 31 Dec 2010 16:49:37 +0200, ville.syrjala at nokia.com wrote:
> > From: Ville Syrjälä <ville.syrjala at nokia.com>
> > 
> > When SourceValidate is performed on a window with IncludeInferiors
> > sub-window mode, force an immediate update of all the automatically
> > redirected windows, so that the current window contents will be up
> > to date.
> 
> Reviewed-by: Keith Packard <keithp at keithp.com>
> 
> > +    pScreen->SourceValidate = cs->SourceValidate;
> > +    if (pDrawable->type == DRAWABLE_WINDOW && subWindowMode == IncludeInferiors)
> > +	compScreenUpdate (pScreen);
> > +    if (pScreen->SourceValidate)
> > +	(*pScreen->SourceValidate) (pDrawable, x, y, width, height,
> > +				    subWindowMode);
> > +    cs->SourceValidate = pScreen->SourceValidate;
> > +    pScreen->SourceValidate = compSourceValidate;
> 
> This looks a bit tricky -- unwrapping SourceValidate before calling
> compScreenUpdate seems like the right order, but I wouldn't mind a nice
> comment here as it's not the 'usual' order of operations for wrapping functions.

To be honest, I didn't even think about it that much. I origianlly just
duplicated the pattern from compBlockHandler(). I also used the same
order of operations in the GetImage wrapper.

But yeah, for SourceValidate unwrapping before updating seems like the
correct order. For GetImage I suppose the order shouldn't really matter.

I can add a comment to SourceValidate. But should I change the order for
GetImage to do the update before unwrapping? If so, compBlockHandler
could also be changed in similar fashion.

-- 
Ville Syrjälä


More information about the xorg-devel mailing list