[cairo] Image scaling performance on X

Boris Zbarsky bzbarsky at MIT.EDU
Tue Feb 27 15:19:51 PST 2007


Eric Anholt wrote:
> Often one can use cairo image surfaces to avoid some of the pain of
> unaccelerated paths hit in the xlib surface.  However, many developers
> (and I would include myself here) argue that we shouldn't add extra code
> to applications to work around these temporary performance problems when
> we're expecting to get those paths accelerated soon.

I understand this position, and the reasons for it; I've run into very similar 
situations with Firefox UI code working around Gecko issues instead of getting 
Gecko fixed.  The problem with this approach if you're not planning to backport 
your performance improvements to existing X servers is that in this particular 
case you're requiring users who want to fix a security bug in their web browser 
to first upgrade X.  With typical Linux distributions, this requires a complete 
distro upgrade.  The user's other option is to have a browser which, as I said, 
freezes up everything for 4-5 seconds whenever it happens to hit a scaled image.

If there were no plans to use cairo except with the new X servers, things would 
be quite different, of course.  But if that were one of the design 
considerations for cairo, it would be a lot less attractive as a graphics layer 
for applications that actually want to work now....

The other possibility is that you do plan to backport your performance work, of 
course.  Given what little work I've done with X, I suspect that's probably not 
very likely (nor is it really worth the effort, I bet).

> For example, right now cairo still doesn't use the server's Render
> gradients support.

I'm not suggesting cairo shouldn't make use of capabilities offered by the 
server.  I _am_ suggesting cairo should perhaps fall back on doing something 
else in common cases when the server is known to have severe problems.  There 
are already checks of this sort in cairo -- see the various Render version 
checks that are performed.  Some of them are checks for particular functionality 
being available, but some are checks for versions that are known to be buggy in 
their handling of particular operations (e.g. tiling).  In my mind, buggy is 
buggy, whether the bug is correctness or abysmal performance (not to be confused 
with merely less-than-optimal performance, which would probably not merit a 
workaround, since it doesn't impact the user experience quite as badly).

-Boris


-Boris


More information about the cairo mailing list