[cairo] [PATCH] stroke_extents: Use a polygon instead of traps

Chris Wilson chris at chris-wilson.co.uk
Thu Jun 20 06:20:12 PDT 2013


On Fri, Jun 14, 2013 at 03:18:10PM +0200, Uli Schlachter wrote:
> Instead of calculating the extents of a cairo_path_fixed_t by converting it into
> traps and getting the traps' extents, this patch implements this operation via
> converting to a polygon and using the polygon's extents.
> 
> This fixes the "get-path-extents" test without breaking anything else. IMHO this
> commit papers over a bug from commit 3cf6551ac7 (see bugzilla), but I am not
> really sure and can only guess.

Yes, the bug is in the expectations of the test case; we are expecting
Cairo to provide a perfect result, but Cairo is working to a specified
tolerance. This tolerance allows it to skip many stages of refinement
and cuts down on its overhead, but also incurs a loss of geometric
precision. I fixed the test case to respect the tolerance that it asks
of Cairo.

This patch is an improvement that avoids the intermediate
trapezoidation.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list