summaryrefslogtreecommitdiff
path: root/src/cairo-rectangle.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-12-18 11:50:00 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-12-18 12:06:47 +0000
commitdea40e61babe608315b6d365094cf518814b134e (patch)
treec4c5f05fdc0fa255ddb2a5f0da495bc70a939474 /src/cairo-rectangle.c
parent3a53e0261b1b5af21bf37e2a211eefd501bd5358 (diff)
downloadcairo-dea40e61babe608315b6d365094cf518814b134e.tar.gz
[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.
Diffstat (limited to 'src/cairo-rectangle.c')
-rw-r--r--src/cairo-rectangle.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cairo-rectangle.c b/src/cairo-rectangle.c
index b13962487..31a530e89 100644
--- a/src/cairo-rectangle.c
+++ b/src/cairo-rectangle.c
@@ -126,6 +126,16 @@ _cairo_rectangle_intersect (cairo_rectangle_int_t *dst,
}
}
+cairo_bool_t
+_cairo_rectangle_intersect_box (cairo_rectangle_int_t *dst,
+ const cairo_box_t *src)
+{
+ cairo_rectangle_int_t rect;
+
+ _cairo_box_round_to_rectangle (src, &rect);
+ return _cairo_rectangle_intersect (dst, &rect);
+}
+
#define P1x (line->p1.x)
#define P1y (line->p1.y)
#define P2x (line->p2.x)