[cairo] Optimize spans in the trapezoid rasterizer

Carl Worth cworth at cworth.org
Mon Jul 25 12:16:42 PDT 2005


On Sun, 24 Jul 2005 22:14:49 -0500, Billy Biggs wrote:
>   The attached patch modifies the 8-bit alpha trapezoid rasterizer in
> libpixman's fbedge.c to specifically handle opaque spans in the middle
> of a trapezoid.  It significantly speeds up large trapezoids without
> slowing down small ones.  The code also allows for optimized
> implementations of a saturated 8-bit add (MMX paddusb) and memset-to-255
> to be easily dropped in.

I haven't looked closely at the implementation yet. But it does seem
to speed things up a bit, (1.2 - 1.4 X speedup for a few "hard" SVG
images here[*]).

But, the patch doesn't seem to give correct results for me. Here's
what I see for the fill-rule test for example:

http://cairographics.org/~cworth/images/fill-rule-image-out-broken.png

(Where the star shapes are intended to be filled, of course.)

[*] I suppose it's about time we had some performance benchmarks
inside cairo. I've got one big SVG image, (gearflowers.svg), which has
LGPL licensing metadata in it so we can redistribute that. I can
probably ask and get licensing permission for one or two more that I
have.

But beyond SVG files, we'll probably want a bunch of micro-benchmark C
programs as well. There is certainly lots of work for eager new
volunteers here...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050725/972c385f/attachment.pgp


More information about the cairo mailing list