[cairo] Path fill bug

Carl Worth cworth at east.isi.edu
Thu Aug 12 16:40:01 PDT 2004

On Fri, 06 Aug 2004 15:29:56 -0600, Charles Tuckey wrote:
> We have discovered a bug in the way cairo (or its backends) fill a 
> particular concave polygon. Using glitz this polygon has some extra fill 
> on its left side; using xlib or pixman the polygon lower interior is not 
> filled. Stroking the polygon works fine.
> I have attached three cairo snippets that illustrate the problem:


Thank you for the excellent bug report along with precise snippets for

The problem you've seen is a known bug[1] in the current CVS version of
the code. It's been there much longer than I would like while we are in
the midst of re-writing the tessellation routine within cairo.

To work around your problem, I suggest you back off to the most recent
cairo snapshot which, as I just checked, does not exhibit this bug with
your test cases:


I don't know if you're using glitz or not, but if so then you'll need to
back up a few snapshots before you find one that is compatible with
cairo 0.1.23:


The current skew between glitz and cairo is precisely because I do not
plan to make a new snapshot until the new tessellator is finished and
this bug is licked.


[1] As seen in cairo/BUGS:

The polygon tessellation routine has problems. It appears that the
following paper has the right answers:


        [Hobby93c] John D. Hobby, Practical Segment Intersection with
        Finite Precision Output, Computation Geometry Theory and
        Applications, 13(4), 1999.

Recent improvements to make the intersection code more robust (using
128-bit arithmetic where needed), have exposed some of the weakness in
the current tessellation implementation. So, for now, filling some
polygons will cause "leaking" until we implement Hobby's algorithm.

More information about the cairo mailing list