diff --git a/ChangeLog b/ChangeLog index 71917fca0..74253d627 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2005-08-21 Billy Biggs + + Fix for bug #4165: + + * src/cairo-hull.c: (_cairo_hull_vertex_compare): Use pointer + comparison for coincident points to ensure a well-defined + ordering, and avoid setting discard on both points. This fixes + problems with my Mac's implementation of qsort. Final patch by + Bertram Felgenhauer. + + * test/clip-operator-ref.png: + * test/linear-gradient-ref.png: + * test/operator-clear-ref.png: + * test/operator-source-ref.png: + * test/unantialiased-shapes-ref.png: + * test/unbounded-operator-ref.png: Update reference images after + the change. + 2005-08-21 Owen Taylor * autogen.sh: Check automake- if automake isn't sufficiently diff --git a/src/cairo-hull.c b/src/cairo-hull.c index c93d70625..34e0588af 100644 --- a/src/cairo-hull.c +++ b/src/cairo-hull.c @@ -97,7 +97,12 @@ _cairo_hull_vertex_compare (const void *av, const void *bv) (cairo_fixed_48_16_t) a->slope.dy * a->slope.dy); b_dist = ((cairo_fixed_48_16_t) b->slope.dx * b->slope.dx + (cairo_fixed_48_16_t) b->slope.dy * b->slope.dy); - if (a_dist < b_dist) { + /* + * Use pointer comparison for coincident points to ensure + * a well-defined ordering, and avoid setting discard on + * both points. + */ + if (a_dist < b_dist || (a_dist == b_dist && a < b)) { a->discard = 1; ret = -1; } else { diff --git a/test/clip-operator-ref.png b/test/clip-operator-ref.png index 1cd0e5be1..d1be82b3d 100644 Binary files a/test/clip-operator-ref.png and b/test/clip-operator-ref.png differ diff --git a/test/linear-gradient-ref.png b/test/linear-gradient-ref.png index 77904144d..021b50173 100644 Binary files a/test/linear-gradient-ref.png and b/test/linear-gradient-ref.png differ diff --git a/test/operator-clear-ref.png b/test/operator-clear-ref.png index 538024a26..4ee43f1cc 100644 Binary files a/test/operator-clear-ref.png and b/test/operator-clear-ref.png differ diff --git a/test/operator-source-ref.png b/test/operator-source-ref.png index 77b6abab8..a0102139d 100644 Binary files a/test/operator-source-ref.png and b/test/operator-source-ref.png differ diff --git a/test/unantialiased-shapes-ref.png b/test/unantialiased-shapes-ref.png index b94859224..ad7999327 100644 Binary files a/test/unantialiased-shapes-ref.png and b/test/unantialiased-shapes-ref.png differ diff --git a/test/unbounded-operator-ref.png b/test/unbounded-operator-ref.png index b197c00ce..ff7a9624a 100644 Binary files a/test/unbounded-operator-ref.png and b/test/unbounded-operator-ref.png differ