diff options
author | Owen Taylor <otaylor@redhat.com> | 2005-04-13 14:01:50 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@redhat.com> | 2005-04-13 14:01:50 +0000 |
commit | 542e6c8c90a76bb9ccbedd95c8c65103c68ae6b6 (patch) | |
tree | a8f72ef015f1a407e90061acf7a77defa8f6d45b /src/cairo-traps.c | |
parent | 1de5ace6c22b457d4c712b9d8c9e8fb87e927c43 (diff) |
Work around a pair of libpixman bugs (denegerate trapezoids from tesellator, pixman_region_union_rect() failing on width/height zero rectangles)
Diffstat (limited to 'src/cairo-traps.c')
-rw-r--r-- | src/cairo-traps.c | 7 |
1 files changed, 7 insertions, 0 deletions
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) { |