third_party/cairo/src/cairo-path-stroke-tristrip.c
static void
add_fan (struct stroker *stroker,
	 const cairo_slope_t *in_vector,
	 const cairo_slope_t *out_vector,
	 const cairo_point_t *midpt,
	 const cairo_point_t *inpt,
	 const cairo_point_t *outpt,
	 cairo_bool_t clockwise)
{
    int start, stop, step, i, npoints;

    if (clockwise) {
	step  = 1;

	start = _cairo_pen_find_active_cw_vertex_index (&stroker->pen,
							in_vector);
	if (_cairo_slope_compare (&stroker->pen.vertices[start].slope_cw,
				  in_vector) < 0)
	    start = range_step (start, 1, stroker->pen.num_vertices);

	stop  = _cairo_pen_find_active_cw_vertex_index (&stroker->pen,
							out_vector);
	if (_cairo_slope_compare (&stroker->pen.vertices[stop].slope_ccw,
				  out_vector) > 0)
	{
	    stop = range_step (stop, -1, stroker->pen.num_vertices);
	    if (_cairo_slope_compare (&stroker->pen.vertices[stop].slope_cw,
				      in_vector) < 0)
		return;
	}

	npoints = stop - start;
    } else {
	step  = -1;

	start = _cairo_pen_find_active_ccw_vertex_index (&stroker->pen,
							 in_vector);
	if (_cairo_slope_compare (&stroker->pen.vertices[start].slope_ccw,
				  in_vector) < 0)
	    start = range_step (start, -1, stroker->pen.num_vertices);

	stop  = _cairo_pen_find_active_ccw_vertex_index (&stroker->pen,
							 out_vector);
	if (_cairo_slope_compare (&stroker->pen.vertices[stop].slope_cw,
				  out_vector) > 0)
	{
	    stop = range_step (stop, 1, stroker->pen.num_vertices);
	    if (_cairo_slope_compare (&stroker->pen.vertices[stop].slope_ccw,
				      in_vector) < 0)
		return;
	}

	npoints = start - stop;
    }
    stop = range_step (stop, step, stroker->pen.num_vertices);
    if (npoints < 0)
	npoints += stroker->pen.num_vertices;
    if (npoints <= 1)
	return;

    for (i = start;
	 i != stop;
	i = range_step (i, step, stroker->pen.num_vertices))
    {
	cairo_point_t p = *midpt;
	translate_point (&p, &stroker->pen.vertices[i].point);
	//contour_add_point (stroker, c, &p);
    }
}
/*
 * Construct a fan around the midpoint using the vertices from pen between
 * inpt and outpt.
 */
Construct a fan around the midpoint using the vertices from pen between
inpt and outpt.
Construct a fan around the midpoint using the vertices from pen between inpt and outpt .
static void
add_fan (struct stroker *stroker,
	 const cairo_slope_t *in_vector,
	 const cairo_slope_t *out_vector,
	 const cairo_point_t *midpt,
	 const cairo_point_t *inpt,
	 const cairo_point_t *outpt,
	 cairo_bool_t clockwise)
{
    int start, stop, step, i, npoints;
    if (clockwise) {
	step  = 1;
	start = _cairo_pen_find_active_cw_vertex_index (&stroker->pen,
							in_vector);
	if (_cairo_slope_compare (&stroker->pen.vertices[start].slope_cw,
				  in_vector) < 0)
	    start = range_step (start, 1, stroker->pen.num_vertices);
	stop  = _cairo_pen_find_active_cw_vertex_index (&stroker->pen,
							out_vector);
	if (_cairo_slope_compare (&stroker->pen.vertices[stop].slope_ccw,
				  out_vector) > 0)
	{
	    stop = range_step (stop, -1, stroker->pen.num_vertices);
	    if (_cairo_slope_compare (&stroker->pen.vertices[stop].slope_cw,
				      in_vector) < 0)
		return;
	}
	npoints = stop - start;
    } else {
	step  = -1;
	start = _cairo_pen_find_active_ccw_vertex_index (&stroker->pen,
							 in_vector);
	if (_cairo_slope_compare (&stroker->pen.vertices[start].slope_ccw,
				  in_vector) < 0)
	    start = range_step (start, -1, stroker->pen.num_vertices);
	stop  = _cairo_pen_find_active_ccw_vertex_index (&stroker->pen,
							 out_vector);
	if (_cairo_slope_compare (&stroker->pen.vertices[stop].slope_cw,
				  out_vector) > 0)
	{
	    stop = range_step (stop, 1, stroker->pen.num_vertices);
	    if (_cairo_slope_compare (&stroker->pen.vertices[stop].slope_ccw,
				      in_vector) < 0)
		return;
	}
	npoints = start - stop;
    }
    stop = range_step (stop, step, stroker->pen.num_vertices);
    if (npoints < 0)
	npoints += stroker->pen.num_vertices;
    if (npoints <= 1)
	return;
    for (i = start;
	 i != stop;
	i = range_step (i, step, stroker->pen.num_vertices))
    {
	cairo_point_t p = *midpt;
	translate_point (&p, &stroker->pen.vertices[i].point);
    }
}
static void add_fan ( struct stroker * stroker , const cairo_slope_t * in_vector , const cairo_slope_t * out_vector , const cairo_point_t * midpt , const cairo_point_t * inpt , const cairo_point_t * outpt , cairo_bool_t clockwise ) { int start , stop , step , i , npoints ; if ( clockwise ) { step = 1 ; start = _cairo_pen_find_active_cw_vertex_index ( & stroker -> pen , in_vector ) ; if ( _cairo_slope_compare ( & stroker -> pen . vertices [ start ] . slope_cw , in_vector ) < 0 ) start = range_step ( start , 1 , stroker -> pen . num_vertices ) ; stop = _cairo_pen_find_active_cw_vertex_index ( & stroker -> pen , out_vector ) ; if ( _cairo_slope_compare ( & stroker -> pen . vertices [ stop ] . slope_ccw , out_vector ) > 0 ) { stop = range_step ( stop , -1 , stroker -> pen . num_vertices ) ; if ( _cairo_slope_compare ( & stroker -> pen . vertices [ stop ] . slope_cw , in_vector ) < 0 ) return ; } npoints = stop - start ; } else { step = -1 ; start = _cairo_pen_find_active_ccw_vertex_index ( & stroker -> pen , in_vector ) ; if ( _cairo_slope_compare ( & stroker -> pen . vertices [ start ] . slope_ccw , in_vector ) < 0 ) start = range_step ( start , -1 , stroker -> pen . num_vertices ) ; stop = _cairo_pen_find_active_ccw_vertex_index ( & stroker -> pen , out_vector ) ; if ( _cairo_slope_compare ( & stroker -> pen . vertices [ stop ] . slope_cw , out_vector ) > 0 ) { stop = range_step ( stop , 1 , stroker -> pen . num_vertices ) ; if ( _cairo_slope_compare ( & stroker -> pen . vertices [ stop ] . slope_ccw , in_vector ) < 0 ) return ; } npoints = start - stop ; } stop = range_step ( stop , step , stroker -> pen . num_vertices ) ; if ( npoints < 0 ) npoints += stroker -> pen . num_vertices ; if ( npoints <= 1 ) return ; for ( i = start ; i != stop ; i = range_step ( i , step , stroker -> pen . num_vertices ) ) { cairo_point_t p = * midpt ; translate_point ( & p , & stroker -> pen . vertices [ i ] . point ) ; } }
Construct a fan around the midpoint using the vertices from pen between
 inpt and outpt.
Construct a fan around the midpoint using the vertices from pen between inpt and outpt .
//contour_add_point (stroker, c, &p);