[gtk+/wip/otte/rendernode: 35/110] gsk: Add GskRenderNodeClass.make_immutable()



commit 6298586fd972202bf776266c4383364044d92180
Author: Benjamin Otte <otte redhat com>
Date:   Sun Dec 11 11:53:17 2016 +0100

    gsk: Add GskRenderNodeClass.make_immutable()

 gsk/gskrendernode.c        |   11 ++---------
 gsk/gskrendernodeimpl.c    |   32 +++++++++++++++++++++++++++++---
 gsk/gskrendernodeprivate.h |    1 +
 3 files changed, 32 insertions(+), 12 deletions(-)
---
diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c
index 2126723..62b0caf 100644
--- a/gsk/gskrendernode.c
+++ b/gsk/gskrendernode.c
@@ -841,19 +841,12 @@ gsk_render_node_get_blend_mode (GskRenderNode *node)
 void
 gsk_render_node_make_immutable (GskRenderNode *node)
 {
-  GskRenderNode *child;
-
   if (!node->is_mutable)
     return;
 
-  node->is_mutable = FALSE;
+  node->node_class->make_immutable (node);
 
-  for (child = gsk_render_node_get_first_child (node);
-       child != NULL;
-       child = gsk_render_node_get_next_sibling (child))
-    {
-      gsk_render_node_make_immutable (child);
-    }
+  node->is_mutable = FALSE;
 }
 
 /*< private >
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index b3ba475..288bacf 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -41,11 +41,17 @@ gsk_texture_node_finalize (GskRenderNode *node)
   gsk_texture_unref (self->texture);
 }
 
+static void
+gsk_texture_node_make_immutable (GskRenderNode *node)
+{
+}
+
 static const GskRenderNodeClass GSK_TEXTURE_NODE_CLASS = {
   GSK_TEXTURE_NODE,
   sizeof (GskTextureNode),
   "GskTextureNode",
-  gsk_texture_node_finalize
+  gsk_texture_node_finalize,
+  gsk_texture_node_make_immutable
 };
 
 GskTexture *
@@ -109,11 +115,17 @@ gsk_cairo_node_finalize (GskRenderNode *node)
     cairo_surface_destroy (self->surface);
 }
 
+static void
+gsk_cairo_node_make_immutable (GskRenderNode *node)
+{
+}
+
 static const GskRenderNodeClass GSK_CAIRO_NODE_CLASS = {
   GSK_CAIRO_NODE,
   sizeof (GskCairoNode),
   "GskCairoNode",
-  gsk_cairo_node_finalize
+  gsk_cairo_node_finalize,
+  gsk_cairo_node_make_immutable
 };
 
 /*< private >
@@ -252,11 +264,25 @@ gsk_container_node_finalize (GskRenderNode *node)
 {
 }
 
+static void
+gsk_container_node_make_immutable (GskRenderNode *node)
+{
+  GskRenderNode *child;
+
+  for (child = gsk_render_node_get_first_child (node);
+       child != NULL;
+       child = gsk_render_node_get_next_sibling (child))
+    {
+      gsk_render_node_make_immutable (child);
+    }
+}
+
 static const GskRenderNodeClass GSK_CONTAINER_NODE_CLASS = {
   GSK_CONTAINER_NODE,
   sizeof (GskRenderNode),
   "GskContainerNode",
-  gsk_container_node_finalize
+  gsk_container_node_finalize,
+  gsk_container_node_make_immutable
 };
 
 /**
diff --git a/gsk/gskrendernodeprivate.h b/gsk/gskrendernodeprivate.h
index 1d46db8..5ffb48e 100644
--- a/gsk/gskrendernodeprivate.h
+++ b/gsk/gskrendernodeprivate.h
@@ -62,6 +62,7 @@ struct _GskRenderNodeClass
   gsize struct_size;
   const char *type_name;
   void (* finalize) (GskRenderNode *node);
+  void (* make_immutable) (GskRenderNode *node);
 };
 
 GskRenderNode *gsk_render_node_new (const GskRenderNodeClass *node_class);


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