Fix for bug #4165:

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.
Update reference images after the change.
This commit is contained in:
Billy Biggs 2005-08-21 11:41:44 +00:00
parent d93d56caef
commit 17845df95b
8 changed files with 24 additions and 1 deletions

View file

@ -1,3 +1,21 @@
2005-08-21 Billy Biggs <vektor@dumbterm.net>
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 <otaylor@redhat.com>
* autogen.sh: Check automake-<ver> if automake isn't sufficiently

View file

@ -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 {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB