summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-02-22 08:26:29 +0100
committerBenjamin Otte <otte@redhat.com>2015-03-18 15:23:32 +0100
commit399df06d1931add5d5b0422f6f99fe4ff1a1faa7 (patch)
tree2abd169e6cbad9a0c85b6b784e4ea06a8f379e1b
parent6dd19306eb982597fcf8e9d809128cef5c952dd3 (diff)
downloadgtk+-399df06d1931add5d5b0422f6f99fe4ff1a1faa7.tar.gz
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.
-rw-r--r--gtk/gtkcssnode.c2
-rw-r--r--gtk/gtkcssnodeprivate.h2
-rw-r--r--gtk/gtkstylecontext.c26
3 files changed, 2 insertions, 28 deletions
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 2c032ed989..0aaf64d56f 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 38cd36d891..1fb0a4970e 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 d1ae36971f..1dd917afa8 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,