diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/cairo-traps.c | 7 |
2 files changed, 13 insertions, 0 deletions
@@ -1,5 +1,11 @@ 2005-04-13 Owen Taylor <otaylor@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) + +2005-04-13 Owen Taylor <otaylor@redhat.com> + * src/cairoint.h src/cairo-traps.c: Add _cairo_traps_extract_region for converting trapezoids into a pixman region. diff --git a/src/cairo-traps.c b/src/cairo-traps.c index f0892922..b8a08bf4 100644 --- a/src/cairo-traps.c +++ b/src/cairo-traps.c @@ -782,6 +782,13 @@ _cairo_traps_extract_region (cairo_traps_t *traps, 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) { |