[gtk+/wip/cssnode3: 70/88] stylecontext: Refactor gtk_style_context_invalidate()



commit 538510b99cc8d42bdecccbe8e5a8e04d9c1cf638
Author: Benjamin Otte <otte redhat com>
Date:   Sun Feb 22 08:26:29 2015 +0100

    stylecontext: Refactor gtk_style_context_invalidate()
    
    There's no need anymore to recreate styles, nodes do that automagically
    now.
    
    This allows making gtk_css_node_set_style() private.

 gtk/gtkcssnode.c        |    2 +-
 gtk/gtkcssnodeprivate.h |    2 --
 gtk/gtkstylecontext.c   |   26 +-------------------------
 3 files changed, 2 insertions(+), 28 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 2c032ed..0aaf64d 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -592,7 +592,7 @@ gtk_css_node_get_next_sibling (GtkCssNode *cssnode)
   return cssnode->next_sibling;
 }
 
-void
+static void
 gtk_css_node_set_style (GtkCssNode  *cssnode,
                         GtkCssStyle *style)
 {
diff --git a/gtk/gtkcssnodeprivate.h b/gtk/gtkcssnodeprivate.h
index 38cd36d..1fb0a49 100644
--- a/gtk/gtkcssnodeprivate.h
+++ b/gtk/gtkcssnodeprivate.h
@@ -137,8 +137,6 @@ const GtkCssNodeDeclaration *
 
 
 GtkCssStyle *           gtk_css_node_get_style          (GtkCssNode            *cssnode);
-void                    gtk_css_node_set_style          (GtkCssNode            *cssnode,
-                                                         GtkCssStyle           *style);
 GtkCssStyle *           gtk_css_node_create_style       (GtkCssNode            *cssnode);
 
 void                    gtk_css_node_invalidate_style_provider
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 5d40750..339c068 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -2386,22 +2386,6 @@ gtk_style_context_pop_animatable_region (GtkStyleContext *context)
 }
 
 static void
-gtk_style_context_clear_cache (GtkStyleContext *context)
-{
-  GtkStyleContextPrivate *priv;
-  GSList *l;
-
-  priv = context->priv;
-
-  for (l = priv->saved_nodes; l; l = l->next)
-    {
-      gtk_css_node_set_style (l->data, NULL);
-    }
-
-  gtk_style_context_clear_property_cache (context);
-}
-
-static void
 gtk_style_context_do_invalidate (GtkStyleContext  *context,
                                  const GtkBitmask *changes)
 {
@@ -2450,18 +2434,10 @@ void
 gtk_style_context_invalidate (GtkStyleContext *context)
 {
   GtkBitmask *changes;
-  GtkCssStyle *style;
-  GtkCssNode *root;
 
   g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
 
-  gtk_style_context_clear_cache (context);
-  gtk_css_node_set_style (context->priv->cssnode, NULL);
-
-  root = gtk_style_context_get_root (context);
-  style = gtk_css_node_create_style (root);
-  gtk_css_node_set_style (root, style);
-  g_object_unref (style);
+  gtk_style_context_clear_property_cache (context);
 
   changes = _gtk_bitmask_new ();
   changes = _gtk_bitmask_invert_range (changes,


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