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.
This commit is contained in:
Benjamin Otte 2015-02-22 08:26:29 +01:00
parent 6dd19306eb
commit 399df06d19
3 changed files with 2 additions and 28 deletions

View File

@ -592,7 +592,7 @@ gtk_css_node_get_next_sibling (GtkCssNode *cssnode)
return cssnode->next_sibling; return cssnode->next_sibling;
} }
void static void
gtk_css_node_set_style (GtkCssNode *cssnode, gtk_css_node_set_style (GtkCssNode *cssnode,
GtkCssStyle *style) GtkCssStyle *style)
{ {

View File

@ -137,8 +137,6 @@ const GtkCssNodeDeclaration *
GtkCssStyle * gtk_css_node_get_style (GtkCssNode *cssnode); 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); GtkCssStyle * gtk_css_node_create_style (GtkCssNode *cssnode);
void gtk_css_node_invalidate_style_provider void gtk_css_node_invalidate_style_provider

View File

@ -2385,22 +2385,6 @@ gtk_style_context_pop_animatable_region (GtkStyleContext *context)
g_return_if_fail (GTK_IS_STYLE_CONTEXT (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 static void
gtk_style_context_do_invalidate (GtkStyleContext *context, gtk_style_context_do_invalidate (GtkStyleContext *context,
const GtkBitmask *changes) const GtkBitmask *changes)
@ -2450,18 +2434,10 @@ void
gtk_style_context_invalidate (GtkStyleContext *context) gtk_style_context_invalidate (GtkStyleContext *context)
{ {
GtkBitmask *changes; GtkBitmask *changes;
GtkCssStyle *style;
GtkCssNode *root;
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context)); g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
gtk_style_context_clear_cache (context); gtk_style_context_clear_property_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);
changes = _gtk_bitmask_new (); changes = _gtk_bitmask_new ();
changes = _gtk_bitmask_invert_range (changes, changes = _gtk_bitmask_invert_range (changes,