[cairo-commit] cairo/src cairo-hull.c,1.8,1.9

Billy Biggs commit at pdx.freedesktop.org
Mon Aug 22 04:41:46 EST 2005


Committed by: vektor

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv5871/src

Modified Files:
	cairo-hull.c 
Log Message:
	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.



Index: cairo-hull.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-hull.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cairo-hull.c	22 Feb 2005 19:35:03 -0000	1.8
+++ cairo-hull.c	21 Aug 2005 18:41:44 -0000	1.9
@@ -97,7 +97,12 @@
 		  (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 {



More information about the cairo-commit mailing list