[librsvg] Rename rsvg_node_draw_from_stack() to rsvg_drawing_ctx_draw_node_from_stack()



commit 8411039335cb6b26b581fa8ce680cbe4877c60fc
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Mar 16 19:00:04 2017 -0600

    Rename rsvg_node_draw_from_stack() to rsvg_drawing_ctx_draw_node_from_stack()
    
    This is really the concern of RsvgDrawingCtx, since it has
    the drawing stack in question.
    
    Moved this function from rsvg-structure.c to rsvg-base.c, which is where
    most of the other RsvgDrawingCtx functions are.

 rsvg-base.c         |   33 +++++++++++++++++++++++++++++++--
 rsvg-cairo-draw.c   |    2 +-
 rsvg-cairo-render.c |    2 +-
 rsvg-private.h      |    3 +++
 rsvg-structure.c    |   35 +++--------------------------------
 rsvg-structure.h    |    2 --
 6 files changed, 39 insertions(+), 38 deletions(-)
---
diff --git a/rsvg-base.c b/rsvg-base.c
index f138cd7..ee655f1 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -1585,7 +1585,7 @@ rsvg_handle_get_dimensions_sub (RsvgHandle * handle, RsvgDimensionData * dimensi
             sself = rsvg_node_get_parent (sself);
         }
 
-        rsvg_node_draw_from_stack (handle->priv->treebase, draw, 0);
+        rsvg_drawing_ctx_draw_node_from_stack (draw, handle->priv->treebase, 0);
         bbox = RSVG_CAIRO_RENDER (draw->render)->bbox;
 
         rsvg_drawing_ctx_free (draw);
@@ -1679,7 +1679,7 @@ rsvg_handle_get_position_sub (RsvgHandle * handle, RsvgPositionData * position_d
         node = rsvg_node_get_parent (node);
     }
 
-    rsvg_node_draw_from_stack (handle->priv->treebase, draw, 0);
+    rsvg_drawing_ctx_draw_node_from_stack (draw, handle->priv->treebase, 0);
     bbox = RSVG_CAIRO_RENDER (draw->render)->bbox;
 
     rsvg_drawing_ctx_free (draw);
@@ -2313,6 +2313,35 @@ rsvg_drawing_ctx_release_node (RsvgDrawingCtx * ctx, RsvgNode *node)
   ctx->acquired_nodes = g_slist_remove (ctx->acquired_nodes, node);
 }
 
+void
+rsvg_drawing_ctx_draw_node_from_stack (RsvgDrawingCtx *ctx, RsvgNode *node, int dominate)
+{
+    RsvgState *state;
+    GSList *stacksave;
+
+    stacksave = ctx->drawsub_stack;
+    if (stacksave) {
+        RsvgNode *stack_node = stacksave->data;
+
+        if (!rsvg_node_is_same (stack_node, node))
+            return;
+
+        ctx->drawsub_stack = stacksave->next;
+    }
+
+    state = rsvg_node_get_state (node);
+
+    if (state->visible) {
+        rsvg_state_push (ctx);
+
+        rsvg_node_draw (node, ctx, dominate);
+
+        rsvg_state_pop (ctx);
+    }
+
+    ctx->drawsub_stack = stacksave;
+}
+
 cairo_matrix_t
 rsvg_drawing_ctx_get_current_state_affine (RsvgDrawingCtx *ctx)
 {
diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
index 47e10d5..117f062 100644
--- a/rsvg-cairo-draw.c
+++ b/rsvg-cairo-draw.c
@@ -959,7 +959,7 @@ rsvg_cairo_get_surface_of_node (RsvgDrawingCtx *ctx,
     render = rsvg_cairo_render_new (cr, width, height);
     ctx->render = (RsvgRender *) render;
 
-    rsvg_node_draw_from_stack (drawable, ctx, 0);
+    rsvg_drawing_ctx_draw_node_from_stack (ctx, drawable, 0);
 
     cairo_destroy (cr);
 
diff --git a/rsvg-cairo-render.c b/rsvg-cairo-render.c
index c81fdc1..1afa60c 100644
--- a/rsvg-cairo-render.c
+++ b/rsvg-cairo-render.c
@@ -241,7 +241,7 @@ rsvg_handle_render_cairo_sub (RsvgHandle * handle, cairo_t * cr, const char *id)
 
     cairo_save (cr);
 
-    rsvg_node_draw_from_stack (handle->priv->treebase, draw, 0);
+    rsvg_drawing_ctx_draw_node_from_stack (draw, handle->priv->treebase, 0);
 
     cairo_restore (cr);
 
diff --git a/rsvg-private.h b/rsvg-private.h
index ad44591..b735d72 100644
--- a/rsvg-private.h
+++ b/rsvg-private.h
@@ -453,6 +453,9 @@ G_GNUC_INTERNAL
 void rsvg_drawing_ctx_release_node              (RsvgDrawingCtx * ctx, RsvgNode *node);
 
 G_GNUC_INTERNAL
+void rsvg_drawing_ctx_draw_node_from_stack (RsvgDrawingCtx *ctx, RsvgNode *node, int dominate);
+
+G_GNUC_INTERNAL
 void rsvg_render_path_builder   (RsvgDrawingCtx * ctx, RsvgPathBuilder *builder);
 G_GNUC_INTERNAL
 void rsvg_render_surface        (RsvgDrawingCtx * ctx, cairo_surface_t *surface,
diff --git a/rsvg-structure.c b/rsvg-structure.c
index bc85b7f..d902a04 100644
--- a/rsvg-structure.c
+++ b/rsvg-structure.c
@@ -52,35 +52,6 @@ struct _RsvgNodeUse {
     RsvgLength x, y, w, h;
 };
 
-void
-rsvg_node_draw_from_stack (RsvgNode *node, RsvgDrawingCtx * ctx, int dominate)
-{
-    RsvgState *state;
-    GSList *stacksave;
-
-    stacksave = ctx->drawsub_stack;
-    if (stacksave) {
-        RsvgNode *stack_node = stacksave->data;
-
-        if (!rsvg_node_is_same (stack_node, node))
-            return;
-
-        ctx->drawsub_stack = stacksave->next;
-    }
-
-    state = rsvg_node_get_state (node);
-
-    if (state->visible) {
-        rsvg_state_push (ctx);
-
-        rsvg_node_draw (node, ctx, dominate);
-
-        rsvg_state_pop (ctx);
-    }
-
-    ctx->drawsub_stack = stacksave;
-}
-
 static gboolean
 draw_child (RsvgNode *node, gpointer data)
 {
@@ -88,7 +59,7 @@ draw_child (RsvgNode *node, gpointer data)
 
     ctx = data;
 
-    rsvg_node_draw_from_stack (node, ctx, 0);
+    rsvg_drawing_ctx_draw_node_from_stack (ctx, node, 0);
 
     return TRUE;
 }
@@ -350,7 +321,7 @@ rsvg_node_use_draw (RsvgNode *node, gpointer impl, RsvgDrawingCtx *ctx, int domi
         cairo_matrix_multiply (&state->affine, &affine, &state->affine);
 
         rsvg_push_discrete_layer (ctx);
-        rsvg_node_draw_from_stack (child, ctx, 1);
+        rsvg_drawing_ctx_draw_node_from_stack (ctx, child, 1);
         rsvg_pop_discrete_layer (ctx);
     } else {
         RsvgNodeSymbol *symbol = rsvg_rust_cnode_get_impl (child);
@@ -518,7 +489,7 @@ draw_child_if_cond_true_and_stop (RsvgNode *node, gpointer data)
     ctx = data;
 
     if (rsvg_node_get_state (node)->cond_true) {
-        rsvg_node_draw_from_stack (node, ctx, 0);
+        rsvg_drawing_ctx_draw_node_from_stack (ctx, node, 0);
 
         return FALSE;
     } else {
diff --git a/rsvg-structure.h b/rsvg-structure.h
index 60f1c29..cce76f2 100644
--- a/rsvg-structure.h
+++ b/rsvg-structure.h
@@ -59,8 +59,6 @@ struct _RsvgNodeSvg {
 };
 
 G_GNUC_INTERNAL
-void rsvg_node_draw_from_stack  (RsvgNode *node, RsvgDrawingCtx * ctx, int dominate);
-G_GNUC_INTERNAL
 void _rsvg_node_draw_children   (RsvgNode *node, RsvgDrawingCtx * ctx, int dominate);
 
 G_GNUC_INTERNAL


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]