[cairo] Fwd: Gradient mesh rasterizer

Andrea Canciani ranma42 at gmail.com
Fri Jul 24 03:22:33 PDT 2009


I just noticed that two messages I wanted to send to the mailing list
were only sent to a single person instead.
Sorry for the inconvenience.
Andrea Canciani


---------- Forwarded message ----------
From: Andrea Canciani <ranma42 at gmail.com>
Date: Sat, Jul 18, 2009 at 7:36 PM
Subject: Re: [cairo] Gradient mesh rasterizer
To: Jeff Muizelaar <jeff at infidigm.net>


Here is the rasterizer with tessellation and clipping. It should have
reasonable performance (i.e. linear in the number of painted pixels)
even  for almost-degenerate patterns and for patterns mainly outside
of the viewport.
draw_bezier_curve is clearly the hot-spot here and is needs to be
rewritten to use integer arithmetic (but it should be quite possible
now, since the maximum number of steps is chosen and tessellation is
done to enfoce it).
AFD might speed up the filling in some cases (you can see it if you
increase USHIFT and/or VSHIFT), but for the values in the code, on my
machine it didn't make any measurable difference.
Hopefully I will get a fast inner loop soon (using 32-bit integer
math), but in the meantime I would like to verify that the changes I
made are ok.
There are some small differences between the image produced by this
version and the ones produced by the reference version (using only
gradient_tile, without any call to split_v) and all of them are due to
roundoff errors or to different steps when rasterizing the surfaces (a
bigger step can be used if you tessellate as the sub-surfaces have
lower curvature).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pattern.c
Type: application/octet-stream
Size: 13922 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20090724/8a92d32a/attachment-0001.obj 


More information about the cairo mailing list