[gtk+/wip/cssnode3: 70/81] stylecontext: Refactor gtk_style_context_invalidate()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssnode3: 70/81] stylecontext: Refactor gtk_style_context_invalidate()
- Date: Sat, 28 Feb 2015 23:15:36 +0000 (UTC)
commit 70fe51308c52bbf4bad4543dcdc2e12cac24e974
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 892083d..948a14a 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 b67248e..09ac77f 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -2385,22 +2385,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)
{
@@ -2449,18 +2433,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]