[cairo] [cairo-commit] 13 commits - doc/tutorial src/cairo-analysis-surface.c src/cairo-clip.c src/cairo-image-surface.c src/cairoint.h src/cairo-meta-surface.c src/cairo-paginated-surface.c src/cairo-path-bounds.c src/cairo-pattern.c src/cairo-pdf-surface.c src/cairo-rectangle.c src/cairo-scaled-font.c src/cairo-script-surface.c src/cairo-surface.c src/cairo-surface-fallback.c src/cairo-svg-surface.c src/cairo-type3-glyph-surface.c src/cairo-xlib-surface.c src/test-meta-surface.c src/test-paginated-surface.c test/twin.c test/twin.pdf.ref.png test/twin.ref.png util/cairo-script util/cairo-trace
Jeff Muizelaar
jeff at infidigm.net
Thu Dec 18 06:25:30 PST 2008
On Thu, Dec 18, 2008 at 04:12:50AM -0800, Chris Wilson wrote:
> New commits:
> commit dea40e61babe608315b6d365094cf518814b134e
> Author: Chris Wilson <chris at chris-wilson.co.uk>
> Date: Thu Dec 18 11:50:00 2008 +0000
>
> [path] Return the fixed-point bounds of the path
>
> When analysing the stroke extents, we need the original fixed-point
> extents so that we do not incur an OBO when we round-to-integer a second
> time. We also need a more accurate estimate than simply using the control
> points of the curve, so pass in tolerance and decompose until someone
> discovers a cheaper algorithm to determine the precise aligned bounding
> box of a bezier curve.
>
With this patch I don't think _cairo_path_fixed_approximate_extents and
the comment above it make sense any more. Also, are we sure we don't want a
version that just uses the control points any more?
> + cairo_rectangle_int_t mask_extents;
> + double dx, dy;
> +
> + _cairo_path_fixed_approximate_extents (path, &mask_extents);
> +
> + _cairo_stroke_style_max_distance_from_path (style, ctm, &dx, &dy);
> +
> + mask_extents.width += mask_extents.x + ceil (dx);
> + mask_extents.x -= ceil (dx);
> + mask_extents.width -= mask_extents.x;
>
> - _cairo_traps_extents (&traps, &box);
> - _cairo_traps_fini (&traps);
> + mask_extents.height += mask_extents.y + ceil (dy);
> + mask_extents.y -= ceil (dy);
> + mask_extents.height -= mask_extents.y;
>
> - _cairo_box_round_to_rectangle (&box, &extents);
> + is_empty = _cairo_rectangle_intersect (&extents, &mask_extents);
> }
Should this be in a function like
_cairo_path_fixed_approximate_stroke_extents?
-Jeff
More information about the cairo
mailing list