From 0f8af054841c2d6dfe4bfeb3d13a7bab0cfbe2f3 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 3 Aug 2009 08:27:01 +0100 Subject: [PATCH] [fallback] Avoid tessellating empty polygons I added an assert inside the tessellator to ensure that empty polygon were not being propagated that far... --- src/cairo-surface-fallback.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c index b97eb1932..bba26a7af 100644 --- a/src/cairo-surface-fallback.c +++ b/src/cairo-surface-fallback.c @@ -663,8 +663,8 @@ _clip_and_composite_trapezoids (const cairo_pattern_t *src, cairo_bool_t clip_surface = FALSE; cairo_status_t status; - if (_cairo_operator_bounded_by_mask (op) && traps->num_traps == 0) - return CAIRO_STATUS_SUCCESS; + if (traps->num_traps == 0 && _cairo_operator_bounded_by_mask (op)) + return CAIRO_STATUS_SUCCESS; if (clip != NULL) { status = _cairo_clip_get_region (clip, &clip_region); @@ -1019,6 +1019,9 @@ _cairo_surface_fallback_stroke (cairo_surface_t *surface, if (unlikely (status)) goto CLEANUP; + if (polygon.num_edges == 0) + goto DO_TRAPS; + if (_cairo_operator_bounded_by_mask (op)) { cairo_rectangle_int_t polygon_extents; @@ -1161,6 +1164,9 @@ _cairo_surface_fallback_fill (cairo_surface_t *surface, if (unlikely (status)) goto CLEANUP; + if (polygon.num_edges == 0) + goto DO_TRAPS; + if (_cairo_operator_bounded_by_mask (op)) { cairo_rectangle_int_t polygon_extents;