[gtk+] stylecontext: Pass a bitmask to the changed values
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] stylecontext: Pass a bitmask to the changed values
- Date: Fri, 30 Nov 2012 19:10:55 +0000 (UTC)
commit 4ccb8e5d330aa448cfb8263feba5c59c367957d2
Author: Benjamin Otte <otte redhat com>
Date: Fri Nov 30 13:58:11 2012 +0100
stylecontext: Pass a bitmask to the changed values
gtk/gtkstylecontext.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 8da3682..a11ed5f 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -372,7 +372,7 @@ struct _GtkStyleContextPrivate
GtkCssChange relevant_changes;
GtkCssChange pending_changes;
- guint invalidating_context : 1;
+ const GtkBitmask *invalidating_context;
guint invalid : 1;
};
@@ -2971,7 +2971,8 @@ gtk_style_context_update_cache (GtkStyleContext *context,
}
static void
-gtk_style_context_do_invalidate (GtkStyleContext *context)
+gtk_style_context_do_invalidate (GtkStyleContext *context,
+ const GtkBitmask *changes)
{
GtkStyleContextPrivate *priv;
@@ -2983,11 +2984,11 @@ gtk_style_context_do_invalidate (GtkStyleContext *context)
if (priv->invalidating_context)
return;
- priv->invalidating_context = TRUE;
+ priv->invalidating_context = changes;
g_signal_emit (context, signals[CHANGED], 0);
- priv->invalidating_context = FALSE;
+ priv->invalidating_context = NULL;
}
static GtkBitmask *
@@ -3177,7 +3178,7 @@ _gtk_style_context_validate (GtkStyleContext *context,
}
if (!_gtk_bitmask_is_empty (changes) || (change & GTK_CSS_CHANGE_FORCE_INVALIDATE))
- gtk_style_context_do_invalidate (context);
+ gtk_style_context_do_invalidate (context, changes);
change = _gtk_css_change_for_child (change);
for (list = priv->children; list; list = list->next)
@@ -3226,10 +3227,18 @@ _gtk_style_context_queue_invalidate (GtkStyleContext *context,
void
gtk_style_context_invalidate (GtkStyleContext *context)
{
+ GtkBitmask *changes;
+
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
gtk_style_context_clear_cache (context);
- gtk_style_context_do_invalidate (context);
+
+ changes = _gtk_bitmask_new ();
+ changes = _gtk_bitmask_invert_range (changes,
+ 0,
+ _gtk_css_style_property_get_n_properties ());
+ gtk_style_context_do_invalidate (context, changes);
+ _gtk_bitmask_free (changes);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]