[librsvg] Don't try to access a node->state directly, use rsvg_node_get_state() instead
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] Don't try to access a node->state directly, use rsvg_node_get_state() instead
- Date: Fri, 17 Feb 2017 16:39:09 +0000 (UTC)
commit c29590058adf3269e716e49296ea0efbb45a19d2
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Feb 14 19:39:35 2017 -0600
Don't try to access a node->state directly, use rsvg_node_get_state() instead
rsvg-cairo-clip.c | 9 ++++++---
rsvg-cairo-draw.c | 15 ++++++++++-----
2 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/rsvg-cairo-clip.c b/rsvg-cairo-clip.c
index 672bd0c..d4361bb 100644
--- a/rsvg-cairo-clip.c
+++ b/rsvg-cairo-clip.c
@@ -143,12 +143,15 @@ rsvg_cairo_clip (RsvgDrawingCtx * ctx, RsvgNode *node_clip_path, RsvgBbox * bbox
RsvgClipPath *clip;
RsvgCairoRender *save = RSVG_CAIRO_RENDER (ctx->render);
cairo_matrix_t affinesave;
+ RsvgState *clip_path_state;
g_assert (rsvg_node_get_type (node_clip_path) == RSVG_NODE_TYPE_CLIP_PATH);
clip = rsvg_rust_cnode_get_impl (node_clip_path);
ctx->render = rsvg_cairo_clip_render_new (save->cr, save);
+ clip_path_state = rsvg_node_get_state (node_clip_path);
+
/* Horribly dirty hack to have the bbox premultiplied to everything */
if (clip->units == objectBoundingBox) {
cairo_matrix_t bbtransform;
@@ -159,8 +162,8 @@ rsvg_cairo_clip (RsvgDrawingCtx * ctx, RsvgNode *node_clip_path, RsvgBbox * bbox
bbox->rect.height,
bbox->rect.x,
bbox->rect.y);
- affinesave = clip->super.state->affine;
- cairo_matrix_multiply (&clip->super.state->affine, &bbtransform, &clip->super.state->affine);
+ affinesave = clip_path_state->affine;
+ cairo_matrix_multiply (&clip_path_state->affine, &bbtransform, &clip_path_state->affine);
}
rsvg_state_push (ctx);
@@ -168,7 +171,7 @@ rsvg_cairo_clip (RsvgDrawingCtx * ctx, RsvgNode *node_clip_path, RsvgBbox * bbox
rsvg_state_pop (ctx);
if (clip->units == objectBoundingBox)
- clip->super.state->affine = affinesave;
+ clip_path_state->affine = affinesave;
g_free (ctx->render);
cairo_clip (save->cr);
diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
index ce92d18..3e19fba 100644
--- a/rsvg-cairo-draw.c
+++ b/rsvg-cairo-draw.c
@@ -671,6 +671,8 @@ rsvg_cairo_generate_mask (cairo_t * cr, RsvgNode *node_mask, RsvgDrawingCtx *ctx
/* Horribly dirty hack to have the bbox premultiplied to everything */
if (self->contentunits == objectBoundingBox) {
cairo_matrix_t bbtransform;
+ RsvgState *mask_state;
+
cairo_matrix_init (&bbtransform,
bbox->rect.width,
0,
@@ -678,8 +680,11 @@ rsvg_cairo_generate_mask (cairo_t * cr, RsvgNode *node_mask, RsvgDrawingCtx *ctx
bbox->rect.height,
bbox->rect.x,
bbox->rect.y);
- affinesave = self->super.state->affine;
- cairo_matrix_multiply (&self->super.state->affine, &bbtransform, &self->super.state->affine);
+
+ mask_state = rsvg_node_get_state (node_mask);
+
+ affinesave = mask_state->affine;
+ cairo_matrix_multiply (&mask_state->affine, &bbtransform, &mask_state->affine);
rsvg_drawing_ctx_push_view_box (ctx, 1, 1);
}
@@ -688,12 +693,12 @@ rsvg_cairo_generate_mask (cairo_t * cr, RsvgNode *node_mask, RsvgDrawingCtx *ctx
rsvg_state_pop (ctx);
if (self->contentunits == objectBoundingBox) {
- RsvgState *state;
+ RsvgState *mask_state;
rsvg_drawing_ctx_pop_view_box (ctx);
- state = rsvg_node_get_state (node_mask);
- state->affine = affinesave;
+ mask_state = rsvg_node_get_state (node_mask);
+ mask_state->affine = affinesave;
}
render->cr = save_cr;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]