Commit 358a8152 authored by Christian Persch's avatar Christian Persch

Use cairo_append_path

Just call cairo_append_path() instead of duplicating it (twice!).
parent 0215e044
......@@ -67,7 +67,6 @@ rsvg_cairo_clip_render_path (RsvgDrawingCtx * ctx, const cairo_path_t *path)
RsvgCairoRender *cairo_render = &render->super;
RsvgState *state = rsvg_current_state (ctx);
cairo_t *cr;
const cairo_path_data_t *data, *end;
cr = cairo_render->cr;
......@@ -75,26 +74,7 @@ rsvg_cairo_clip_render_path (RsvgDrawingCtx * ctx, const cairo_path_t *path)
cairo_set_fill_rule (cr, rsvg_current_state (ctx)->clip_rule);
end = &path->data[path->num_data];
for (data = &path->data[0]; data < end; data += data->header.length) {
switch (data[0].header.type) {
case CAIRO_PATH_CLOSE_PATH:
cairo_close_path (cr);
break;
case CAIRO_PATH_MOVE_TO:
cairo_move_to (cr, data[1].point.x, data[1].point.y);
break;
case CAIRO_PATH_CURVE_TO:
cairo_curve_to (cr,
data[1].point.x, data[1].point.y,
data[2].point.x, data[2].point.y,
data[3].point.x, data[3].point.y);
break;
case CAIRO_PATH_LINE_TO:
cairo_line_to (cr, data[1].point.x, data[1].point.y);
break;
}
}
cairo_append_path (cr, path);
}
static void
......
......@@ -444,7 +444,6 @@ rsvg_cairo_render_path (RsvgDrawingCtx * ctx, const cairo_path_t *path)
int need_tmpbuf = 0;
RsvgBbox bbox;
double backup_tolerance;
const cairo_path_data_t *data, *end;
if (state->fill == NULL && state->stroke == NULL)
return;
......@@ -469,26 +468,7 @@ rsvg_cairo_render_path (RsvgDrawingCtx * ctx, const cairo_path_t *path)
cairo_set_dash (cr, state->dash.dash, state->dash.n_dash,
_rsvg_css_normalize_length (&state->dash.offset, ctx, 'o'));
end = &path->data[path->num_data];
for (data = &path->data[0]; data < end; data += data->header.length) {
switch (data[0].header.type) {
case CAIRO_PATH_CLOSE_PATH:
cairo_close_path (cr);
break;
case CAIRO_PATH_MOVE_TO:
cairo_move_to (cr, data[1].point.x, data[1].point.y);
break;
case CAIRO_PATH_CURVE_TO:
cairo_curve_to (cr,
data[1].point.x, data[1].point.y,
data[2].point.x, data[2].point.y,
data[3].point.x, data[3].point.y);
break;
case CAIRO_PATH_LINE_TO:
cairo_line_to (cr, data[1].point.x, data[1].point.y);
break;
}
}
cairo_append_path (cr, path);
rsvg_bbox_init (&bbox, &state->affine);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment