static inline cairo_status_t
event_queue_insert_if_intersect_below_current_y (cairo_bo_event_queue_t	*event_queue,
						 cairo_bo_edge_t	*left,
						 cairo_bo_edge_t *right)
{
    cairo_bo_intersect_point_t intersection;

    if (_line_equal (&left->edge.line, &right->edge.line))
	return CAIRO_STATUS_SUCCESS;

    /* The names "left" and "right" here are correct descriptions of
     * the order of the two edges within the active edge list. So if a
     * slope comparison also puts left less than right, then we know
     * that the intersection of these two segments has already
     * occurred before the current sweep line position. */
    if (_slope_compare (left, right) <= 0)
	return CAIRO_STATUS_SUCCESS;

    if (! _cairo_bo_edge_intersect (left, right, &intersection))
	return CAIRO_STATUS_SUCCESS;

    return _cairo_bo_event_queue_insert (event_queue,
					 CAIRO_BO_EVENT_TYPE_INTERSECTION,
					 left, right,
					 &intersection);
}
示例#2
0
static cairo_status_t
_cairo_bo_event_queue_insert_stop (cairo_bo_event_queue_t	*event_queue,
				   cairo_bo_edge_t		*edge)
{
    cairo_bo_point32_t point;

    point.y = edge->edge.bottom;
    point.x = _line_compute_intersection_x_for_y (&edge->edge.line,
						  point.y);
    return _cairo_bo_event_queue_insert (event_queue,
					 CAIRO_BO_EVENT_TYPE_STOP,
					 edge, NULL,
					 &point);
}
static cairo_status_t
event_queue_insert_stop (cairo_bo_event_queue_t	*event_queue,
			 cairo_bo_edge_t		*edge)
{
    cairo_bo_intersect_point_t point;

    point.y.ordinate = edge->edge.bottom;
    point.y.approx   = EXACT;
    point.x.ordinate = _line_compute_intersection_x_for_y (&edge->edge.line,
							   point.y.ordinate);
    point.x.approx   = EXACT;

    return _cairo_bo_event_queue_insert (event_queue,
					 CAIRO_BO_EVENT_TYPE_STOP,
					 edge, NULL,
					 &point);
}