spans: Fix empty polygon unbounded fixup

There is a subtle flaw in the current querying of polygon extents; it
simply returns the limits and not the point extremeties and certainly
not the tessellation extents. Computing that is likely to take long than
rendering the polygon. This does mean that we need to also fixup the
extents prior to performing the empty unbounded fast path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-09-23 23:24:25 +01:00
parent 9a366cff2c
commit d71ce5e0dd

View file

@ -782,6 +782,11 @@ clip_and_composite_polygon (const cairo_spans_compositor_t *compositor,
{
cairo_int_status_t status;
/* XXX simply uses polygon limits.point extemities, tessellation? */
status = trim_extents_to_polygon (extents, polygon);
if (unlikely (status))
return status;
if (_cairo_polygon_is_empty (polygon)) {
cairo_boxes_t boxes;
@ -789,14 +794,10 @@ clip_and_composite_polygon (const cairo_spans_compositor_t *compositor,
return CAIRO_STATUS_SUCCESS;
_cairo_boxes_init (&boxes);
extents->bounded.width = extents->bounded.height = 0;
return fixup_unbounded_boxes (compositor, extents, &boxes);
}
#if 0 /* XXX not accurate currently... */
if (antialias == CAIRO_ANTIALIAS_NONE)
return CAIRO_INT_STATUS_UNSUPPORTED;
#endif
if (extents->is_bounded && extents->clip->path) {
cairo_polygon_t clipper;
cairo_antialias_t clip_antialias;
@ -825,10 +826,6 @@ clip_and_composite_polygon (const cairo_spans_compositor_t *compositor,
}
}
status = trim_extents_to_polygon (extents, polygon);
if (unlikely (status))
return status;
return composite_polygon (compositor, extents,
polygon, fill_rule, antialias);
}