Rename _rsvg_{push,pop}_view_box to rsvg_drawing_ctx_{push,pop}_view_box

The operations act on a RsvgDrawingCtx, so start making the
naming consistent like that.
parent 84af994c
......@@ -2361,7 +2361,7 @@ rsvg_bbox_clip (RsvgBbox * dst, RsvgBbox * src)
}
void
_rsvg_push_view_box (RsvgDrawingCtx * ctx, double w, double h)
rsvg_drawing_ctx_push_view_box (RsvgDrawingCtx * ctx, double w, double h)
{
RsvgViewBox *vb = g_new (RsvgViewBox, 1);
*vb = ctx->vb;
......@@ -2371,7 +2371,7 @@ _rsvg_push_view_box (RsvgDrawingCtx * ctx, double w, double h)
}
void
_rsvg_pop_view_box (RsvgDrawingCtx * ctx)
rsvg_drawing_ctx_pop_view_box (RsvgDrawingCtx * ctx)
{
ctx->vb = *((RsvgViewBox *) ctx->vb_stack->data);
g_free (ctx->vb_stack->data);
......
......@@ -100,14 +100,14 @@ _set_source_rsvg_linear_gradient (RsvgDrawingCtx * ctx,
rsvg_linear_gradient_fix_fallback (ctx, linear);
if (linear->obj_bbox)
_rsvg_push_view_box (ctx, 1., 1.);
rsvg_drawing_ctx_push_view_box (ctx, 1., 1.);
pattern = cairo_pattern_create_linear (_rsvg_css_normalize_length (&linear->x1, ctx),
_rsvg_css_normalize_length (&linear->y1, ctx),
_rsvg_css_normalize_length (&linear->x2, ctx),
_rsvg_css_normalize_length (&linear->y2, ctx));
if (linear->obj_bbox)
_rsvg_pop_view_box (ctx);
rsvg_drawing_ctx_pop_view_box (ctx);
matrix = linear->affine;
if (linear->obj_bbox) {
......@@ -208,7 +208,7 @@ _set_source_rsvg_radial_gradient (RsvgDrawingCtx * ctx,
rsvg_radial_gradient_fix_fallback (ctx, radial);
if (radial->obj_bbox)
_rsvg_push_view_box (ctx, 1., 1.);
rsvg_drawing_ctx_push_view_box (ctx, 1., 1.);
fx = _rsvg_css_normalize_length (&radial->fx, ctx);
fy = _rsvg_css_normalize_length (&radial->fy, ctx);
......@@ -223,7 +223,7 @@ _set_source_rsvg_radial_gradient (RsvgDrawingCtx * ctx,
cx, cy, radius);
if (radial->obj_bbox)
_rsvg_pop_view_box (ctx);
rsvg_drawing_ctx_pop_view_box (ctx);
matrix = radial->affine;
if (radial->obj_bbox) {
......@@ -287,7 +287,7 @@ _set_source_rsvg_pattern (RsvgDrawingCtx * ctx,
cr_render = render->cr;
if (rsvg_pattern->obj_bbox)
_rsvg_push_view_box (ctx, 1., 1.);
rsvg_drawing_ctx_push_view_box (ctx, 1., 1.);
patternx = _rsvg_css_normalize_length (&rsvg_pattern->x, ctx);
patterny = _rsvg_css_normalize_length (&rsvg_pattern->y, ctx);
......@@ -295,7 +295,7 @@ _set_source_rsvg_pattern (RsvgDrawingCtx * ctx,
patternh = _rsvg_css_normalize_length (&rsvg_pattern->height, ctx);
if (rsvg_pattern->obj_bbox)
_rsvg_pop_view_box (ctx);
rsvg_drawing_ctx_pop_view_box (ctx);
/* Work out the size of the rectangle so it takes into account the object bounding box */
......@@ -359,11 +359,11 @@ _set_source_rsvg_pattern (RsvgDrawingCtx * ctx,
h / rsvg_pattern->vbox.rect.height,
x,
y);
_rsvg_push_view_box (ctx, rsvg_pattern->vbox.rect.width, rsvg_pattern->vbox.rect.height);
rsvg_drawing_ctx_push_view_box (ctx, rsvg_pattern->vbox.rect.width, rsvg_pattern->vbox.rect.height);
} else if (rsvg_pattern->obj_cbbox) {
/* If coords are in terms of the bounding box, use them */
cairo_matrix_init_scale (&caffine, bbox.rect.width, bbox.rect.height);
_rsvg_push_view_box (ctx, 1., 1.);
rsvg_drawing_ctx_push_view_box (ctx, 1., 1.);
} else {
cairo_matrix_init_identity (&caffine);
}
......@@ -411,7 +411,7 @@ _set_source_rsvg_pattern (RsvgDrawingCtx * ctx,
out:
if (rsvg_pattern->obj_cbbox || rsvg_pattern->vbox.active)
_rsvg_pop_view_box (ctx);
rsvg_drawing_ctx_pop_view_box (ctx);
}
/* note: _set_source_rsvg_paint_server does not change cairo's CTM */
......@@ -734,7 +734,7 @@ rsvg_cairo_generate_mask (cairo_t * cr, RsvgMask * self, RsvgDrawingCtx * ctx, R
rowstride = cairo_image_surface_get_stride (surface);
if (self->maskunits == objectBoundingBox)
_rsvg_push_view_box (ctx, 1, 1);
rsvg_drawing_ctx_push_view_box (ctx, 1, 1);
sx = _rsvg_css_normalize_length (&self->x, ctx);
sy = _rsvg_css_normalize_length (&self->y, ctx);
......@@ -742,7 +742,7 @@ rsvg_cairo_generate_mask (cairo_t * cr, RsvgMask * self, RsvgDrawingCtx * ctx, R
sh = _rsvg_css_normalize_length (&self->height, ctx);
if (self->maskunits == objectBoundingBox)
_rsvg_pop_view_box (ctx);
rsvg_drawing_ctx_pop_view_box (ctx);
mask_cr = cairo_create (surface);
save_cr = render->cr;
......@@ -769,7 +769,7 @@ rsvg_cairo_generate_mask (cairo_t * cr, RsvgMask * self, RsvgDrawingCtx * ctx, R
bbox->rect.y);
affinesave = self->super.state->affine;
cairo_matrix_multiply (&self->super.state->affine, &bbtransform, &self->super.state->affine);
_rsvg_push_view_box (ctx, 1, 1);
rsvg_drawing_ctx_push_view_box (ctx, 1, 1);
}
rsvg_state_push (ctx);
......@@ -777,7 +777,7 @@ rsvg_cairo_generate_mask (cairo_t * cr, RsvgMask * self, RsvgDrawingCtx * ctx, R
rsvg_state_pop (ctx);
if (self->contentunits == objectBoundingBox) {
_rsvg_pop_view_box (ctx);
rsvg_drawing_ctx_pop_view_box (ctx);
self->super.state->affine = affinesave;
}
......
......@@ -160,13 +160,13 @@ rsvg_filter_primitive_get_bounds (RsvgFilterPrimitive * self, RsvgFilterContext
rsvg_bbox_init (&otherbox, &ctx->affine);
otherbox.virgin = 0;
if (ctx->filter->filterunits == objectBoundingBox)
_rsvg_push_view_box (ctx->ctx, 1., 1.);
rsvg_drawing_ctx_push_view_box (ctx->ctx, 1., 1.);
otherbox.rect.x = _rsvg_css_normalize_length (&ctx->filter->x, ctx->ctx);
otherbox.rect.y = _rsvg_css_normalize_length (&ctx->filter->y, ctx->ctx);
otherbox.rect.width = _rsvg_css_normalize_length (&ctx->filter->width, ctx->ctx);
otherbox.rect.height = _rsvg_css_normalize_length (&ctx->filter->height, ctx->ctx);
if (ctx->filter->filterunits == objectBoundingBox)
_rsvg_pop_view_box (ctx->ctx);
rsvg_drawing_ctx_pop_view_box (ctx->ctx);
rsvg_bbox_insert (&box, &otherbox);
......@@ -177,7 +177,7 @@ rsvg_filter_primitive_get_bounds (RsvgFilterPrimitive * self, RsvgFilterContext
rsvg_bbox_init (&otherbox, &ctx->paffine);
otherbox.virgin = 0;
if (ctx->filter->primitiveunits == objectBoundingBox)
_rsvg_push_view_box (ctx->ctx, 1., 1.);
rsvg_drawing_ctx_push_view_box (ctx->ctx, 1., 1.);
if (self->x_specified)
otherbox.rect.x = _rsvg_css_normalize_length (&self->x, ctx->ctx);
else
......@@ -195,7 +195,7 @@ rsvg_filter_primitive_get_bounds (RsvgFilterPrimitive * self, RsvgFilterContext
else
otherbox.rect.height = ctx->ctx->vb.rect.height;
if (ctx->filter->primitiveunits == objectBoundingBox)
_rsvg_pop_view_box (ctx->ctx);
rsvg_drawing_ctx_pop_view_box (ctx->ctx);
rsvg_bbox_clip (&box, &otherbox);
}
......
......@@ -154,7 +154,7 @@ rsvg_marker_render (const char * marker_name, gdouble xpos, gdouble ypos, gdoubl
cairo_matrix_init_scale (&taffine, w / self->vbox.rect.width, h / self->vbox.rect.height);
cairo_matrix_multiply (&affine, &taffine, &affine);
_rsvg_push_view_box (ctx, self->vbox.rect.width, self->vbox.rect.height);
rsvg_drawing_ctx_push_view_box (ctx, self->vbox.rect.width, self->vbox.rect.height);
}
cairo_matrix_init_translate (&taffine,
......@@ -196,7 +196,7 @@ rsvg_marker_render (const char * marker_name, gdouble xpos, gdouble ypos, gdoubl
rsvg_state_pop (ctx);
if (self->vbox.active)
_rsvg_pop_view_box (ctx);
rsvg_drawing_ctx_pop_view_box (ctx);
rsvg_release_node (ctx, (RsvgNode *) self);
}
......@@ -440,9 +440,9 @@ G_GNUC_INTERNAL
RsvgLength rsvg_length_parse (const char *str, LengthDir dir);
G_GNUC_INTERNAL
void _rsvg_push_view_box (RsvgDrawingCtx * ctx, double w, double h);
void rsvg_drawing_ctx_push_view_box (RsvgDrawingCtx * ctx, double w, double h);
G_GNUC_INTERNAL
void _rsvg_pop_view_box (RsvgDrawingCtx * ctx);
void rsvg_drawing_ctx_pop_view_box (RsvgDrawingCtx * ctx);
G_GNUC_INTERNAL
void rsvg_SAX_handler_struct_init (void);
G_GNUC_INTERNAL
......
......@@ -221,7 +221,7 @@ rsvg_node_use_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
cairo_matrix_init_translate (&affine, -symbol->vbox.rect.x, -symbol->vbox.rect.y);
cairo_matrix_multiply (&state->affine, &affine, &state->affine);
_rsvg_push_view_box (ctx, symbol->vbox.rect.width, symbol->vbox.rect.height);
rsvg_drawing_ctx_push_view_box (ctx, symbol->vbox.rect.width, symbol->vbox.rect.height);
rsvg_push_discrete_layer (ctx);
if (!state->overflow || (!state->has_overflow && child->state->overflow))
rsvg_add_clipping_rect (ctx, symbol->vbox.rect.x, symbol->vbox.rect.y,
......@@ -237,7 +237,7 @@ rsvg_node_use_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
rsvg_state_pop (ctx);
rsvg_pop_discrete_layer (ctx);
if (symbol->vbox.active)
_rsvg_pop_view_box (ctx);
rsvg_drawing_ctx_pop_view_box (ctx);
}
rsvg_release_node (ctx, child);
......@@ -277,11 +277,11 @@ rsvg_node_svg_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
x - sself->vbox.rect.x * w / sself->vbox.rect.width,
y - sself->vbox.rect.y * h / sself->vbox.rect.height);
cairo_matrix_multiply (&state->affine, &affine, &state->affine);
_rsvg_push_view_box (ctx, sself->vbox.rect.width, sself->vbox.rect.height);
rsvg_drawing_ctx_push_view_box (ctx, sself->vbox.rect.width, sself->vbox.rect.height);
} else {
cairo_matrix_init_translate (&affine, nx, ny);
cairo_matrix_multiply (&state->affine, &affine, &state->affine);
_rsvg_push_view_box (ctx, nw, nh);
rsvg_drawing_ctx_push_view_box (ctx, nw, nh);
}
affine_new = state->affine;
......@@ -303,7 +303,7 @@ rsvg_node_svg_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
}
rsvg_pop_discrete_layer (ctx);
_rsvg_pop_view_box (ctx);
rsvg_drawing_ctx_pop_view_box (ctx);
}
static void
......
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