[cairo] Fwd: Gradient mesh rasterizer

Andrea Canciani ranma42 at gmail.com
Fri Jul 24 03:23:54 PDT 2009


Here is the second message, with the latest version of my code
Andrea Canciani


---------- Forwarded message ----------
From: Andrea Canciani <ranma42 at gmail.com>
Date: Thu, Jul 23, 2009 at 12:42 PM
Subject: Re: [cairo] Gradient mesh rasterizer
To: Petr Kobalíček <kobalicek.petr at gmail.com>


On Wed, Jul 22, 2009 at 11:10 PM, Andrea Canciani<ranma42 at gmail.com> wrote:
> ...
> (Hopefully I'll post a fast implementation real soon)
Here is a new version of the code, with integer arithmetic in the inner loop.
I tried a few different changes and in the end I went for this version.
imagediff spots many difference, but my eyes are unable to find them
just by comparing the images.
NOTE: it assumes that colors are in the range [0-1] and that the
coordinates of all the points of the patch can be represented as 16.16
fixed point numbers.
In the main function I rasterize the patch 100 times to be able to do
some benchmarking. I applied the same change on the other two versions
I posted and I got these times on the computers I have access to:
ppc (G4 PowerPC 1.33 GHz): 2m20.252s vs 0m13.177s vs 0m7.658s
amd64 (Core2 Duo E6550 2.33 GHz): 27.577s vs 3.803s vs 3.936s

I'm compiling with -O3, maybe some more benchmarking could be done
with loop unrolling enabled and by adding "inline" to some of the
functions (with -O3 all of the non-recursive functions in my code get
inlined).
Please test on other architectures and report any regressions (the
regression on amd64 is caused by the extensive use of simd
instructions, boosting the second version floating point calculation
by doing most of them in parallel).
I'm expecially interested in how does the code perform on i386 and I
would love to see if the integer arithmetics gives a decent gain on
architectures without an FPU unit.
Thank you for you time (and cpu cycles)
Andrea Canciani
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pattern.c
Type: application/octet-stream
Size: 13778 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20090724/396bc5cd/attachment.obj 


More information about the cairo mailing list