[PATCH 1/3] composite: Don't backfill non-bg-None windows

Adam Jackson ajax at redhat.com
Mon Oct 4 14:19:43 PDT 2010


On Mon, 2010-10-04 at 13:13 -0700, Aaron Plattner wrote:
> On Mon, Oct 04, 2010 at 12:33:40PM -0700, Adam Jackson wrote:
> > @@ -487,7 +498,18 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
> >      
> >      pPixmap->screen_x = x;
> >      pPixmap->screen_y = y;
> > -    
> > +
> > +    /*
> > +     * If there's no bg=None in the tree, we're done.
> > +     *
> > +     * We could optimize this more by collecting the regions of all the
> > +     * bg=None subwindows and feeding that in as the clip for the
> > +     * CopyArea below, but since window trees are shallow these days it
> > +     * might not be worth the effort.
> > +     */
> > +    if (TraverseTree(pWin, bgNoneVisitWindow, NULL) == WT_NOMATCH)
> > +	return pPixmap;
> 
> I know it makes the diff smaller to do it this way, but the early return
> bugs me since this is directly related to the code below.  It seems like it
> would be cleaner to do this:

Diff minimization wasn't really my goal.  I was going more for the
pattern of "test for fast paths then resort to hard work".  I admit it's
a little unclear, the hard work is long enough that it's not readily
obvious that the blit is the last thing we'd do.

Related, it might be acceptable to just always take the Render path
there, any competent accel layer will reduce that to a blit anyway.
Pixman certainly seems to get it right, at least.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101004/183feddf/attachment.pgp>


More information about the xorg-devel mailing list