mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 14:38:13 +02:00
path: Always interpret in forward direction
Path are always interpreted in forward direction, so the ability of interpreting in the opposite direction (which is very unlikely to be useful at all) can be removed.
This commit is contained in:
parent
83605de995
commit
a8ae8759f5
21 changed files with 7 additions and 34 deletions
|
|
@ -240,7 +240,6 @@ _cairo_debug_print_path (FILE *stream, cairo_path_fixed_t *path)
|
|||
_cairo_fixed_to_double (path->extents.p2.y));
|
||||
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_print_move_to,
|
||||
_print_line_to,
|
||||
_print_curve_to,
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ _cairo_path_bounder_extents (const cairo_path_fixed_t *path,
|
|||
cairo_status_t status;
|
||||
|
||||
bounder.has_extents = FALSE;
|
||||
status = _cairo_path_fixed_interpret (path, CAIRO_DIRECTION_FORWARD,
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
_cairo_path_bounder_move_to,
|
||||
_cairo_path_bounder_line_to,
|
||||
_cairo_path_bounder_curve_to,
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ _cairo_path_fixed_fill_to_polygon (const cairo_path_fixed_t *path,
|
|||
_cairo_filler_init (&filler, tolerance, polygon);
|
||||
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_filler_move_to,
|
||||
_cairo_filler_line_to,
|
||||
_cairo_filler_curve_to,
|
||||
|
|
|
|||
|
|
@ -109,7 +109,6 @@ _cairo_path_fixed_translate (cairo_path_fixed_t *path,
|
|||
cairo_private cairo_status_t
|
||||
_cairo_path_fixed_append (cairo_path_fixed_t *path,
|
||||
const cairo_path_fixed_t *other,
|
||||
cairo_direction_t dir,
|
||||
cairo_fixed_t tx,
|
||||
cairo_fixed_t ty);
|
||||
|
||||
|
|
|
|||
|
|
@ -804,7 +804,6 @@ _cairo_path_buf_add_points (cairo_path_buf_t *buf,
|
|||
|
||||
cairo_status_t
|
||||
_cairo_path_fixed_interpret (const cairo_path_fixed_t *path,
|
||||
cairo_direction_t dir,
|
||||
cairo_path_fixed_move_to_func_t *move_to,
|
||||
cairo_path_fixed_line_to_func_t *line_to,
|
||||
cairo_path_fixed_curve_to_func_t *curve_to,
|
||||
|
|
@ -819,7 +818,7 @@ _cairo_path_fixed_interpret (const cairo_path_fixed_t *path,
|
|||
};
|
||||
cairo_status_t status;
|
||||
const cairo_path_buf_t *buf, *first;
|
||||
cairo_bool_t forward = (dir == CAIRO_DIRECTION_FORWARD);
|
||||
cairo_bool_t forward = TRUE;
|
||||
int step = forward ? 1 : -1;
|
||||
|
||||
buf = first = forward ? cairo_path_head (path) : cairo_path_tail (path);
|
||||
|
|
@ -925,7 +924,6 @@ _append_close_path (void *abstract_closure)
|
|||
cairo_status_t
|
||||
_cairo_path_fixed_append (cairo_path_fixed_t *path,
|
||||
const cairo_path_fixed_t *other,
|
||||
cairo_direction_t dir,
|
||||
cairo_fixed_t tx,
|
||||
cairo_fixed_t ty)
|
||||
{
|
||||
|
|
@ -935,7 +933,7 @@ _cairo_path_fixed_append (cairo_path_fixed_t *path,
|
|||
closure.offset.x = tx;
|
||||
closure.offset.y = ty;
|
||||
|
||||
return _cairo_path_fixed_interpret (other, dir,
|
||||
return _cairo_path_fixed_interpret (other,
|
||||
_append_move_to,
|
||||
_append_line_to,
|
||||
_append_curve_to,
|
||||
|
|
@ -1175,7 +1173,6 @@ _cpf_close_path (void *closure)
|
|||
|
||||
cairo_status_t
|
||||
_cairo_path_fixed_interpret_flat (const cairo_path_fixed_t *path,
|
||||
cairo_direction_t dir,
|
||||
cairo_path_fixed_move_to_func_t *move_to,
|
||||
cairo_path_fixed_line_to_func_t *line_to,
|
||||
cairo_path_fixed_close_path_func_t *close_path,
|
||||
|
|
@ -1185,7 +1182,7 @@ _cairo_path_fixed_interpret_flat (const cairo_path_fixed_t *path,
|
|||
cpf_t flattener;
|
||||
|
||||
if (! path->has_curve_to) {
|
||||
return _cairo_path_fixed_interpret (path, dir,
|
||||
return _cairo_path_fixed_interpret (path,
|
||||
move_to,
|
||||
line_to,
|
||||
NULL,
|
||||
|
|
@ -1198,7 +1195,7 @@ _cairo_path_fixed_interpret_flat (const cairo_path_fixed_t *path,
|
|||
flattener.line_to = line_to;
|
||||
flattener.close_path = close_path;
|
||||
flattener.closure = closure;
|
||||
return _cairo_path_fixed_interpret (path, dir,
|
||||
return _cairo_path_fixed_interpret (path,
|
||||
_cpf_move_to,
|
||||
_cpf_line_to,
|
||||
_cpf_curve_to,
|
||||
|
|
|
|||
|
|
@ -260,7 +260,6 @@ _cairo_path_fixed_in_fill (const cairo_path_fixed_t *path,
|
|||
_cairo_in_fill_init (&in_fill, tolerance, x, y);
|
||||
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_in_fill_move_to,
|
||||
_cairo_in_fill_line_to,
|
||||
_cairo_in_fill_curve_to,
|
||||
|
|
|
|||
|
|
@ -1319,7 +1319,6 @@ _cairo_path_fixed_stroke_to_shaper (cairo_path_fixed_t *path,
|
|||
stroker.closure = closure;
|
||||
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_stroker_move_to,
|
||||
stroker.dash.dashed ?
|
||||
_cairo_stroker_line_to_dashed :
|
||||
|
|
@ -1363,7 +1362,6 @@ _cairo_path_fixed_stroke_to_polygon (const cairo_path_fixed_t *path,
|
|||
_cairo_stroker_limit (&stroker, polygon->limits, polygon->num_limits);
|
||||
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_stroker_move_to,
|
||||
stroker.dash.dashed ?
|
||||
_cairo_stroker_line_to_dashed :
|
||||
|
|
@ -2054,7 +2052,6 @@ _cairo_path_fixed_stroke_rectilinear_to_traps (const cairo_path_fixed_t *path,
|
|||
}
|
||||
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_rectilinear_stroker_move_to,
|
||||
rectilinear_stroker.dash.dashed ?
|
||||
_cairo_rectilinear_stroker_line_to_dashed :
|
||||
|
|
@ -2108,7 +2105,6 @@ _cairo_path_fixed_stroke_rectilinear_to_boxes (const cairo_path_fixed_t *path,
|
|||
}
|
||||
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_rectilinear_stroker_move_to,
|
||||
rectilinear_stroker.dash.dashed ?
|
||||
_cairo_rectilinear_stroker_line_to_dashed :
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ _cairo_path_count (cairo_path_t *path,
|
|||
|
||||
if (flatten) {
|
||||
status = _cairo_path_fixed_interpret_flat (path_fixed,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cpc_move_to,
|
||||
_cpc_line_to,
|
||||
_cpc_close_path,
|
||||
|
|
@ -123,7 +122,6 @@ _cairo_path_count (cairo_path_t *path,
|
|||
tolerance);
|
||||
} else {
|
||||
status = _cairo_path_fixed_interpret (path_fixed,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cpc_move_to,
|
||||
_cpc_line_to,
|
||||
_cpc_curve_to,
|
||||
|
|
@ -264,7 +262,6 @@ _cairo_path_populate (cairo_path_t *path,
|
|||
if (flatten) {
|
||||
double tolerance = _cairo_gstate_get_tolerance (gstate);
|
||||
status = _cairo_path_fixed_interpret_flat (path_fixed,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cpp_move_to,
|
||||
_cpp_line_to,
|
||||
_cpp_close_path,
|
||||
|
|
@ -272,7 +269,6 @@ _cairo_path_populate (cairo_path_t *path,
|
|||
tolerance);
|
||||
} else {
|
||||
status = _cairo_path_fixed_interpret (path_fixed,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cpp_move_to,
|
||||
_cpp_line_to,
|
||||
_cpp_curve_to,
|
||||
|
|
|
|||
|
|
@ -514,7 +514,6 @@ _cairo_pdf_operators_emit_path (cairo_pdf_operators_t *pdf_operators,
|
|||
status = _cairo_pdf_path_rectangle (&info, &box);
|
||||
} else {
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_pdf_path_move_to,
|
||||
_cairo_pdf_path_line_to,
|
||||
_cairo_pdf_path_curve_to,
|
||||
|
|
|
|||
|
|
@ -391,7 +391,6 @@ path_to_qt (cairo_path_fixed_t *path,
|
|||
data.ctm_inverse = ctm_inverse;
|
||||
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_path_to_qpainterpath_move_to,
|
||||
_cairo_path_to_qpainterpath_line_to,
|
||||
_cairo_path_to_qpainterpath_curve_to,
|
||||
|
|
|
|||
|
|
@ -359,7 +359,6 @@ _cairo_quartz_cairo_path_to_quartz_context (cairo_path_fixed_t *path,
|
|||
|
||||
CGContextBeginPath (closure);
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_path_to_quartz_context_move_to,
|
||||
_cairo_path_to_quartz_context_line_to,
|
||||
_cairo_path_to_quartz_context_curve_to,
|
||||
|
|
|
|||
|
|
@ -801,7 +801,7 @@ _cairo_recording_surface_get_path (cairo_surface_t *surface,
|
|||
case CAIRO_COMMAND_FILL:
|
||||
{
|
||||
status = _cairo_path_fixed_append (path,
|
||||
&command->fill.path, CAIRO_DIRECTION_FORWARD,
|
||||
&command->fill.path,
|
||||
0, 0);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2494,7 +2494,7 @@ _cairo_scaled_font_glyph_path (cairo_scaled_font_t *scaled_font,
|
|||
&scaled_glyph);
|
||||
if (status == CAIRO_STATUS_SUCCESS) {
|
||||
status = _cairo_path_fixed_append (path,
|
||||
scaled_glyph->path, CAIRO_DIRECTION_FORWARD,
|
||||
scaled_glyph->path,
|
||||
_cairo_fixed_from_double (glyphs[i].x),
|
||||
_cairo_fixed_from_double (glyphs[i].y));
|
||||
|
||||
|
|
|
|||
|
|
@ -1666,7 +1666,6 @@ _emit_path (cairo_script_surface_t *surface,
|
|||
return status;
|
||||
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_path_move_to,
|
||||
_path_line_to,
|
||||
_path_curve_to,
|
||||
|
|
|
|||
|
|
@ -500,7 +500,6 @@ path_to_sk (cairo_path_fixed_t *path,
|
|||
data.matrix = mat;
|
||||
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
cpc_move_to,
|
||||
cpc_line_to,
|
||||
cpc_curve_to,
|
||||
|
|
|
|||
|
|
@ -725,7 +725,6 @@ _cairo_svg_surface_emit_path (cairo_output_stream_t *output,
|
|||
info.output = output;
|
||||
info.ctm_inverse = ctm_inverse;
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_svg_path_move_to,
|
||||
_cairo_svg_path_line_to,
|
||||
_cairo_svg_path_curve_to,
|
||||
|
|
|
|||
|
|
@ -407,7 +407,6 @@ cairo_type1_font_create_charstring (cairo_type1_font_t *font,
|
|||
path_info.type = type;
|
||||
if (emit_path) {
|
||||
status = _cairo_path_fixed_interpret (scaled_glyph->path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_charstring_move_to,
|
||||
_charstring_line_to,
|
||||
_charstring_curve_to,
|
||||
|
|
|
|||
|
|
@ -588,7 +588,6 @@ _vg_path_from_cairo (vg_path_t *vg_path,
|
|||
vg_path->dcount = 0;
|
||||
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_vg_move_to,
|
||||
_vg_line_to,
|
||||
_vg_curve_to,
|
||||
|
|
|
|||
|
|
@ -1087,7 +1087,6 @@ _cairo_win32_printing_surface_emit_path (cairo_win32_surface_t *surface,
|
|||
|
||||
path_info.surface = surface;
|
||||
return _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_win32_printing_surface_path_move_to,
|
||||
_cairo_win32_printing_surface_path_line_to,
|
||||
_cairo_win32_printing_surface_path_curve_to,
|
||||
|
|
|
|||
|
|
@ -421,7 +421,6 @@ _cairo_xml_emit_path (cairo_xml_t *xml,
|
|||
|
||||
_cairo_xml_printf_start (xml, "<path>");
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cairo_xml_move_to,
|
||||
_cairo_xml_line_to,
|
||||
_cairo_xml_curve_to,
|
||||
|
|
|
|||
|
|
@ -1234,7 +1234,6 @@ typedef cairo_status_t
|
|||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_path_fixed_interpret (const cairo_path_fixed_t *path,
|
||||
cairo_direction_t dir,
|
||||
cairo_path_fixed_move_to_func_t *move_to,
|
||||
cairo_path_fixed_line_to_func_t *line_to,
|
||||
cairo_path_fixed_curve_to_func_t *curve_to,
|
||||
|
|
@ -1243,7 +1242,6 @@ _cairo_path_fixed_interpret (const cairo_path_fixed_t *path,
|
|||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_path_fixed_interpret_flat (const cairo_path_fixed_t *path,
|
||||
cairo_direction_t dir,
|
||||
cairo_path_fixed_move_to_func_t *move_to,
|
||||
cairo_path_fixed_line_to_func_t *line_to,
|
||||
cairo_path_fixed_close_path_func_t *close_path,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue