[cairo] Optimizing CAIRO_EXTEND_REPEAT when no repeating needs to be done

Boris Zbarsky bzbarsky at mit.edu
Thu Nov 30 11:36:50 PST 2006


I've been looking into the performance of background image painting in Mozilla, 
and discovered that at least on Linux with broken RENDER there's a large win to 
be had by not using CAIRO_EXTEND_REPEAT on the background image pattern even for 
a tiled background when we detect that the rect we are painting would fit 
completely inside a single background tile.  The win in this case is, of course, 
that RENDER ends up being used instead of the software fallback.

The same trick apparently helps somewhat on Windows as well, or so I'm told.

I was wondering whether it would make sense to push this check down into cairo 
-- if the entire region being painted would overlap only one copy of the 
pattern, simply ignore the CAIRO_EXTEND_REPEAT as needed to improve performance.

Would that be feasible?

-Boris


More information about the cairo mailing list