[cairo] Paths as paths

Carl Worth cworth at redhat.com
Mon Mar 7 13:44:55 PST 2005


On Mon, 7 Mar 2005 21:21:31 +0100 (CET), Jost Boekemeier wrote:
> > > try to detect paths that will produce problems with stroking
> > > algorithms that convert curve => polygon before stroking and emit
> 
> I fail to see how this could be decided within cairo.

We know that there are many implementations that approximate the
current path with a polygon according to the current tolerance and
then stroke that. And we know that in some cases, (depending on the
width of the stroke, and the curvature of the spline), the results on
the boundary will deviate by more than the tolerance.

Cairo uses a different algorithm. The path is approximated by a
polygon according to the current tolerance, (and the pen is as
well). Then the stroke outline is computed by copying from either the
polygonal path or the pen as appropriate at various points depending
on how the path slope changes. The theory backing up this process is
the convolution of polygonal tracings as described by Guibas et
al.[*].

All that, just to say, that by simply evaluating the current stroking
algorithm, cairo has precisely the information needed to know if a
more naïve algorithm would yield a sufficient result. It merely has to
notice whether or not it ever copied from the pen rather than from the
path when constructing the stroke outline.

> What about fast zooming (without re-tesselating
> everything) or what about path animations?   How
> should we communicate these information to the
> backend?

If we need to change anything in this area, we're going to wait until
the profile data tell us it is necessary. For now, when I look at
profiles, I'm seeing tessellation down below 1% of total rendering
time, (though we still have a fair amount of rasterization and
compositing optimization left to do, of course).

-Carl

[*] Leo Guibas, Lyle Ramshaw, and Jorge Stolfi.
A kinetic framework for computational geometry.
In Proceedings of the IEEE 1983 24th Annual Symposium on the
Foundations of Computer Science, pages 100-111. IEEE Computer Society
Press, 1983
-------------- 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/20050307/22014288/attachment.pgp


More information about the cairo mailing list