static cairo_status_t
_cairo_path_bounder_curve_to (void *closure,
			      const cairo_point_t *b,
			      const cairo_point_t *c,
			      const cairo_point_t *d)
{
    cairo_path_bounder_t *bounder = closure;

    /* If the bbox of the control points is entirely inside, then we
     * do not need to further evaluate the spline.
     */
    if (! bounder->has_point ||
	b->x < bounder->extents.p1.x || b->x > bounder->extents.p2.x ||
	b->y < bounder->extents.p1.y || b->y > bounder->extents.p2.y ||
	c->x < bounder->extents.p1.x || c->x > bounder->extents.p2.x ||
	c->y < bounder->extents.p1.y || c->y > bounder->extents.p2.y ||
	d->x < bounder->extents.p1.x || d->x > bounder->extents.p2.x ||
	d->y < bounder->extents.p1.y || d->y > bounder->extents.p2.y)
    {
	return _cairo_spline_bound (_cairo_path_bounder_line_to, bounder,
				    &bounder->current_point, b, c, d);
    }
    else
    {
	/* All control points are within the current extents. */
	return CAIRO_STATUS_SUCCESS;
    }
}
Пример #2
0
static cairo_status_t
_cairo_path_bounder_curve_to (void *closure,
			      const cairo_point_t *b,
			      const cairo_point_t *c,
			      const cairo_point_t *d)
{
    cairo_path_bounder_t *bounder = closure;

    return _cairo_spline_bound (_cairo_path_bounder_line_to, bounder,
				&bounder->current_point, b, c, d);
}
Пример #3
0
/* assumes a has been previously added */
void
_cairo_box_add_curve_to (cairo_box_t *extents,
			 const cairo_point_t *a,
			 const cairo_point_t *b,
			 const cairo_point_t *c,
			 const cairo_point_t *d)
{
    _cairo_box_add_point (extents, d);
    if (!_cairo_box_contains_point (extents, b) ||
	!_cairo_box_contains_point (extents, c))
    {
	cairo_status_t status;

	status = _cairo_spline_bound (_cairo_box_add_spline_point,
				      extents, a, b, c, d);
	assert (status == CAIRO_STATUS_SUCCESS);
    }
}