[cairo] new gradient code and pixman/xserver optimizations

David Reveman davidr at novell.com
Thu Oct 27 02:59:33 PDT 2005


On Thu, 2005-10-13 at 12:02 -0400, David Reveman wrote:
> During the gnome summit I did some work to make cairo use the gradient
> code in pixman and xserver instead of the code currently in cairo. This
> allows us to do optimizations we couldn't do before and in the xserver
> case we can even accelerate the gradients in similar ways to what glitz
> is doing.
> 
> I've attached a number of patches and a short description of them
> follows. They are probably not ready for going into CVS yet as the fb
> gradient code seam to produce slightly different results than the code
> currently in cairo but it shouldn't take a big effort to fix that.
> 
> 
> pixman-gradient-1.patch - Enables the gradient support in pixman.
> 
> pixman-composite-general-fix-opt-1.patch - Some major performance
> improvements to the general composite code used for gradients and
> transformed images. Like fetching of mask scanline before source
> scanline so that only the necessary pixels from source needs to be
> computed in case of gradients or transformed images as source. This
> patch also include some gradient specific fixes and performance
> improvement.
> 
> cairo-new-gradients-2.patch - Makes cairo use pixman for gradients.
> 
> cairo-xlib-gradients-1.patch - Makes xlib backend use server-side
> gradients when available. To work properly the next patch will have to
> go into the server. There's a weird issue that is mysteriously worked
> around with a call to XSync right now, see the comment in the patch for
> more details on this. BTW, what's the rules for client-side libXrender
> requirements? I just bumped the version requirement in configure.in for
> now.
> 
> xserver-composite-general-fix-and-opt-1.patch - Basically the same as
> pixman-composite-general-fix-opt-1.patch but for the server.
> 
> 
> Once all these patches land in CVS, gradient performance is going to be
> significantly better. There's also some color table code for gradients
> in pixman/xserver that is disabled now but can be enabled in some cases
> for even better performance.
>  

I've attached an additional patch for pixman/xserver that will fix so
that repeat works correctly for both gradients and image surfaces. It
also includes some minor fixes and optimizations to the gradient code.
You need to apply the other gradient patches before this one.

I've been using cairo with all these patches for a few weeks now and I
haven't found any cases where it produces wrong results. A lot of the
test cases in the test suite that include gradients will report to fail
as the new gradient code is producing slightly different results but if
you look at the images they should look correct.

If anyone finds a case where it produces wrong results, please let me
know.

It would be nice if someone could review these patches soon so that we
could get them into CVS. Updating glitz and pdf backend for this new
gradient code is trivial and I'll do that when committing the patches.

-David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pixman-repeat-and-gradient-fixes-1.patch
Type: text/x-patch
Size: 16320 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20051027/938931db/pixman-repeat-and-gradient-fixes-1-0001.bin


More information about the cairo mailing list