mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-25 09:30:18 +01:00
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:
parent
1de5ace6c2
commit
542e6c8c90
2 changed files with 13 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue