[cairo-commit] cairo/src cairo-traps.c,1.24,1.25

Owen Taylor commit at pdx.freedesktop.org
Wed Apr 13 14:01:54 PDT 2005


Committed by: otaylor

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

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

        * src/cairo-traps.c (_cairo_traps_extract_region): Work around
        a pair of libpixman bugs (denegerate trapezoids from tesellator,
        pixman_region_union_rect() failing on width/height zero rectangles)


Index: cairo-traps.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-traps.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cairo-traps.c	13 Apr 2005 18:23:43 -0000	1.24
+++ cairo-traps.c	13 Apr 2005 21:01:50 -0000	1.25
@@ -782,6 +782,13 @@
 	int y = _cairo_fixed_integer_part(traps->traps[i].left.p1.y);
 	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;
+
+	/* Sometimes we get degenerate trapezoids from the pixman tesellator,
+	 * if we call pixman_region_union_rect(), it bizarrly fails on such
+	 * an empty rectangle, so skip them.
+	 */
+	if (width == 0 || height == 0)
+	  continue;
 	
 	if (pixman_region_union_rect (*region, *region,
 				      x, y, width, height) != PIXMAN_REGION_STATUS_SUCCESS) {




More information about the cairo-commit mailing list