mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-10 01:10:26 +01:00
[cairo-pen] Remove status from _cairo_pen_find_active_vertex_*()
This pair of functions unconditionally return SUCCESS, so remove the status return and supporting tests from their callers.
This commit is contained in:
parent
b72b06cc22
commit
4e39e30d83
3 changed files with 13 additions and 31 deletions
|
|
@ -237,21 +237,13 @@ _cairo_stroker_join (cairo_stroker_t *stroker, cairo_stroke_face_t *in, cairo_st
|
|||
|
||||
tri[0] = in->point;
|
||||
if (clockwise) {
|
||||
status = _cairo_pen_find_active_ccw_vertex_index (pen, &in->dev_vector, &start);
|
||||
if (status)
|
||||
return status;
|
||||
_cairo_pen_find_active_ccw_vertex_index (pen, &in->dev_vector, &start);
|
||||
step = -1;
|
||||
status = _cairo_pen_find_active_ccw_vertex_index (pen, &out->dev_vector, &stop);
|
||||
if (status)
|
||||
return status;
|
||||
_cairo_pen_find_active_ccw_vertex_index (pen, &out->dev_vector, &stop);
|
||||
} else {
|
||||
status = _cairo_pen_find_active_cw_vertex_index (pen, &in->dev_vector, &start);
|
||||
if (status)
|
||||
return status;
|
||||
_cairo_pen_find_active_cw_vertex_index (pen, &in->dev_vector, &start);
|
||||
step = +1;
|
||||
status = _cairo_pen_find_active_cw_vertex_index (pen, &out->dev_vector, &stop);
|
||||
if (status)
|
||||
return status;
|
||||
_cairo_pen_find_active_cw_vertex_index (pen, &out->dev_vector, &stop);
|
||||
}
|
||||
|
||||
i = start;
|
||||
|
|
@ -394,14 +386,10 @@ _cairo_stroker_add_cap (cairo_stroker_t *stroker, cairo_stroke_face_t *f)
|
|||
cairo_pen_t *pen = &stroker->pen;
|
||||
|
||||
slope = f->dev_vector;
|
||||
status = _cairo_pen_find_active_cw_vertex_index (pen, &slope, &start);
|
||||
if (status)
|
||||
return status;
|
||||
_cairo_pen_find_active_cw_vertex_index (pen, &slope, &start);
|
||||
slope.dx = -slope.dx;
|
||||
slope.dy = -slope.dy;
|
||||
status = _cairo_pen_find_active_cw_vertex_index (pen, &slope, &stop);
|
||||
if (status)
|
||||
return status;
|
||||
_cairo_pen_find_active_cw_vertex_index (pen, &slope, &stop);
|
||||
|
||||
tri[0] = f->point;
|
||||
tri[1] = f->cw;
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ _cairo_pen_compute_slopes (cairo_pen_t *pen)
|
|||
* counterclockwise order. However, for this function, we care
|
||||
* strongly about which vertex is returned.
|
||||
*/
|
||||
cairo_status_t
|
||||
void
|
||||
_cairo_pen_find_active_cw_vertex_index (cairo_pen_t *pen,
|
||||
cairo_slope_t *slope,
|
||||
int *active)
|
||||
|
|
@ -324,8 +324,6 @@ _cairo_pen_find_active_cw_vertex_index (cairo_pen_t *pen,
|
|||
assert (i < pen->num_vertices);
|
||||
|
||||
*active = i;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Find active pen vertex for counterclockwise edge of stroke at the given slope.
|
||||
|
|
@ -333,7 +331,7 @@ _cairo_pen_find_active_cw_vertex_index (cairo_pen_t *pen,
|
|||
* NOTE: The behavior of this function is sensitive to the sense of
|
||||
* the inequality within _cairo_slope_clockwise/_cairo_slope_counter_clockwise.
|
||||
*/
|
||||
cairo_status_t
|
||||
void
|
||||
_cairo_pen_find_active_ccw_vertex_index (cairo_pen_t *pen,
|
||||
cairo_slope_t *slope,
|
||||
int *active)
|
||||
|
|
@ -352,8 +350,6 @@ _cairo_pen_find_active_ccw_vertex_index (cairo_pen_t *pen,
|
|||
}
|
||||
|
||||
*active = i;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -388,11 +384,9 @@ _cairo_pen_stroke_spline_half (cairo_pen_t *pen,
|
|||
final_slope.dy = -final_slope.dy;
|
||||
}
|
||||
|
||||
status = _cairo_pen_find_active_cw_vertex_index (pen,
|
||||
&initial_slope,
|
||||
&active);
|
||||
if (status)
|
||||
return status;
|
||||
_cairo_pen_find_active_cw_vertex_index (pen,
|
||||
&initial_slope,
|
||||
&active);
|
||||
|
||||
i = start;
|
||||
while (i != stop) {
|
||||
|
|
|
|||
|
|
@ -2112,12 +2112,12 @@ _cairo_pen_add_points_for_slopes (cairo_pen_t *pen,
|
|||
cairo_point_t *c,
|
||||
cairo_point_t *d);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
cairo_private void
|
||||
_cairo_pen_find_active_cw_vertex_index (cairo_pen_t *pen,
|
||||
cairo_slope_t *slope,
|
||||
int *active);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
cairo_private void
|
||||
_cairo_pen_find_active_ccw_vertex_index (cairo_pen_t *pen,
|
||||
cairo_slope_t *slope,
|
||||
int *active);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue