[cairo-commit] cairo/src cairo-traps.c,1.29,1.30

Owen Taylor commit at pdx.freedesktop.org
Sat Aug 27 18:54:05 PDT 2005


Committed by: otaylor

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

Modified Files:
	cairo-traps.c 
Log Message:
2005-08-27  Owen Taylor  <otaylor at redhat.com>

        reviewed by: cworth

        * src/cairo-traps.c (_cairo_traps_extract_region): Make the
        check for rectangular trapezoids simpler and more accurate.
        (#4220, found using test case from Richard Stellingwerff)


Index: cairo-traps.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-traps.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- cairo-traps.c	5 Aug 2005 05:45:59 -0000	1.29
+++ cairo-traps.c	28 Aug 2005 01:54:03 -0000	1.30
@@ -827,16 +827,10 @@
     for (i = 0; i < traps->num_traps; i++)
 	if (!(traps->traps[i].left.p1.x == traps->traps[i].left.p2.x
 	      && traps->traps[i].right.p1.x == traps->traps[i].right.p2.x
-	      && traps->traps[i].left.p1.y == traps->traps[i].right.p1.y
-	      && traps->traps[i].left.p2.y == traps->traps[i].right.p2.y
+	      && _cairo_fixed_is_integer(traps->traps[i].top)
+	      && _cairo_fixed_is_integer(traps->traps[i].bottom)
 	      && _cairo_fixed_is_integer(traps->traps[i].left.p1.x)
-	      && _cairo_fixed_is_integer(traps->traps[i].left.p1.y)
-	      && _cairo_fixed_is_integer(traps->traps[i].left.p2.x)
-	      && _cairo_fixed_is_integer(traps->traps[i].left.p2.y)
-	      && _cairo_fixed_is_integer(traps->traps[i].right.p1.x)
-	      && _cairo_fixed_is_integer(traps->traps[i].right.p1.y)
-	      && _cairo_fixed_is_integer(traps->traps[i].right.p2.x)
-	      && _cairo_fixed_is_integer(traps->traps[i].right.p2.y))) {
+	      && _cairo_fixed_is_integer(traps->traps[i].right.p1.x))) {
 	    *region = NULL;
 	    return CAIRO_STATUS_SUCCESS;
 	}
@@ -845,9 +839,9 @@
 
     for (i = 0; i < traps->num_traps; i++) {
 	int x = _cairo_fixed_integer_part(traps->traps[i].left.p1.x);
-	int y = _cairo_fixed_integer_part(traps->traps[i].left.p1.y);
+	int y = _cairo_fixed_integer_part(traps->traps[i].top);
 	int width = _cairo_fixed_integer_part(traps->traps[i].right.p1.x) - x;
-	int height = _cairo_fixed_integer_part(traps->traps[i].left.p2.y) - y;
+	int height = _cairo_fixed_integer_part(traps->traps[i].bottom) - y;
 
 	/* XXX: Sometimes we get degenerate trapezoids from the tesellator,
 	 * if we call pixman_region_union_rect(), it bizarrly fails on such



More information about the cairo-commit mailing list