Work around a pair of libpixman bugs (denegerate trapezoids from tesellator, pixman_region_union_rect() failing on width/height zero rectangles)

This commit is contained in:
Owen Taylor 2005-04-13 14:01:50 +00:00
parent 1de5ace6c2
commit 542e6c8c90
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,9 @@
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

View file

@ -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) {