Commit acce1f68 authored by Christian Persch's avatar Christian Persch

Use cairo_fill_rule_t directly

parent cd69dc94
......@@ -75,10 +75,7 @@ rsvg_cairo_clip_render_path (RsvgDrawingCtx * ctx, const RsvgBpathDef * bpath_de
rsvg_cairo_clip_apply_affine (render, state->affine);
if (rsvg_current_state (ctx)->clip_rule == FILL_RULE_EVENODD)
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
else /* state->fill_rule == FILL_RULE_NONZERO */
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_WINDING);
cairo_set_fill_rule (cr, rsvg_current_state (ctx)->clip_rule);
for (i = 0; i < bpath_def->n_bpath; i++) {
bpath = &bpath_def->bpath[i];
......
......@@ -558,10 +558,8 @@ rsvg_cairo_render_path (RsvgDrawingCtx * ctx, const RsvgBpathDef * bpath_def)
if (state->fill != NULL) {
int opacity;
if (state->fill_rule == FILL_RULE_EVENODD)
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
else /* state->fill_rule == FILL_RULE_NONZERO */
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_WINDING);
cairo_set_fill_rule (cr, state->fill_rule);
if (!need_tmpbuf)
opacity = (state->fill_opacity * state->opacity) / 255;
......
......@@ -94,8 +94,8 @@ rsvg_state_init (RsvgState * state)
state->cap = RSVG_PATH_STROKE_CAP_BUTT;
state->join = RSVG_PATH_STROKE_JOIN_MITER;
state->stop_opacity = 0xff;
state->fill_rule = FILL_RULE_NONZERO;
state->clip_rule = FILL_RULE_NONZERO;
state->fill_rule = CAIRO_FILL_RULE_WINDING;
state->clip_rule = CAIRO_FILL_RULE_WINDING;
state->enable_background = RSVG_ENABLE_BACKGROUND_ACCUMULATE;
state->comp_op = CAIRO_OPERATOR_OVER;
state->overflow = FALSE;
......@@ -576,17 +576,17 @@ rsvg_parse_style_pair (RsvgHandle * ctx,
} else if (g_str_equal (name, "fill-rule")) {
state->has_fill_rule = TRUE;
if (g_str_equal (value, "nonzero"))
state->fill_rule = FILL_RULE_NONZERO;
state->fill_rule = CAIRO_FILL_RULE_WINDING;
else if (g_str_equal (value, "evenodd"))
state->fill_rule = FILL_RULE_EVENODD;
state->fill_rule = CAIRO_FILL_RULE_EVEN_ODD;
else
state->has_fill_rule = FALSE;
} else if (g_str_equal (name, "clip-rule")) {
state->has_clip_rule = TRUE;
if (g_str_equal (value, "nonzero"))
state->clip_rule = FILL_RULE_NONZERO;
state->clip_rule = CAIRO_FILL_RULE_WINDING;
else if (g_str_equal (value, "evenodd"))
state->clip_rule = FILL_RULE_EVENODD;
state->clip_rule = CAIRO_FILL_RULE_EVEN_ODD;
else
state->has_clip_rule = FALSE;
} else if (g_str_equal (name, "stroke")) {
......
......@@ -51,11 +51,6 @@ typedef enum {
TEXT_ANCHOR_END
} TextAnchor;
enum {
FILL_RULE_EVENODD = 0,
FILL_RULE_NONZERO = 1
};
typedef enum {
UNICODE_BIDI_NORMAL = 0,
UNICODE_BIDI_EMBED = 1,
......
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