Bug 4599

Summary: Missing wedges on some paths
Product: cairo Reporter: tor
Component: win32 backendAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high CC: jwatt
Version: 1.0.0   
Hardware: x86 (IA32)   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: minimal svg testcase
win32 screenshot of testcase
C version of test case
A possible fix (untested and uncommented)
another proposed fix
updated patch

Description tor 2005-09-26 10:26:56 UTC
Poking around openclipart.org with Mozilla SVG using the cairo backend on win32,
I've noticed that some paths have missing wedges on paths.  These examples look
fine with the same version of cairo on linux.
Comment 1 tor 2005-09-26 10:27:39 UTC
Created attachment 3407 [details]
minimal svg testcase
Comment 2 tor 2005-09-26 10:28:12 UTC
Created attachment 3408 [details]
win32 screenshot of testcase
Comment 3 Carl Worth 2005-09-26 10:58:08 UTC
Created attachment 3409 [details]
C version of test case

Here's the SVG test case converted to a cairo-using program using the image
backend.

I would be interested in knowing two things:

1) What are the results from running this program as is on win32? (Here on my
linux machine the results are correct.)

2) What would it take to convert this program from using the image backend to
using cairo's win32 backend?

-Carl
Comment 4 Carl Worth 2005-09-26 10:59:27 UTC
I'm looking into this one.
Comment 5 Carl Worth 2005-09-29 10:01:52 UTC
So far we've determined that the C test case succeed on win32/gcc with a
standalone cairo, and fails on win32/VS with mozilla's cairo.

I think we're seeing compiler-dependent behavior here, rather than anything to
do with standalone vs. mozilla's cairo.

I'm now looking into why we're getting different sets of trapezoids out of the
tessellator in the two cases.
Comment 6 Carl Worth 2005-09-29 14:28:49 UTC
Created attachment 3434 [details] [review]
A possible fix (untested and uncommented)

Here's a possible fix. Please let me know if/what it changes.
Comment 7 Bertram Felgenhauer 2005-09-29 16:53:13 UTC
Created attachment 3436 [details] [review]
another proposed fix

Hmm, maybe qsort moves our hull points around in memory and makes the a<b
comparison not constant? This patch fixes that and a problem with discarding
points on initialisation.
Comment 8 Bertram Felgenhauer 2005-09-29 17:17:12 UTC
Created attachment 3437 [details] [review]
updated patch

Cleaned up version of previous patch (without a bug that that one contained)
Comment 9 Carl Worth 2005-09-29 17:22:00 UTC
The updated patch looks good to me. Please commit, and thanks!
Comment 10 Carl Worth 2005-10-03 12:23:43 UTC
2005-09-30  Bertram Felgenhauer  <int-e@gmx.de>

        reviewed by: keithp

        * src/cairo-hull.c (_cairo_hull_create): simplify id
        initialisation of last patch

        reviewed by: cworth

        * src/cairo-hull.c (_cairo_hull_create),
        (_cairo_hull_vertex_compare): Using a pointer comparison as the
        fallback total order was wrong - these pointers are not stable.
        So we introduce our own total order instead. (#4599)

        * ROADMAP: mark #4599 as fixed

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.