Commit 399df06d authored by Benjamin Otte's avatar Benjamin Otte

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.
parent 6dd19306
......@@ -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)
{
......
......@@ -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
......
......@@ -2385,22 +2385,6 @@ gtk_style_context_pop_animatable_region (GtkStyleContext *context)
g_return_if_fail (GTK_IS_STYLE_CONTEXT (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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment