cssnode: Track pending changes here

... instead of GtkCssWidgetNode.
This commit is contained in:
Benjamin Otte 2015-02-03 15:36:01 +01:00
parent c550cf122a
commit 71813671ef
4 changed files with 8 additions and 16 deletions

View File

@ -531,6 +531,8 @@ void
gtk_css_node_invalidate (GtkCssNode *cssnode,
GtkCssChange change)
{
cssnode->pending_changes |= change;
GTK_CSS_NODE_GET_CLASS (cssnode)->invalidate (cssnode, change);
gtk_css_node_set_invalid (cssnode, TRUE);
@ -565,6 +567,9 @@ gtk_css_node_validate (GtkCssNode *cssnode,
gtk_css_node_set_invalid (cssnode, FALSE);
change |= cssnode->pending_changes;
cssnode->pending_changes = 0;
changes = GTK_CSS_NODE_GET_CLASS (cssnode)->validate (cssnode, timestamp, change, parent_changes);
change = _gtk_css_change_for_child (change);

View File

@ -47,7 +47,9 @@ struct _GtkCssNode
GtkCssNodeDeclaration *decl;
GtkCssStyle *style;
guint invalid :1; /* set if node or a child is invalid */
GtkCssChange pending_changes; /* changes that accumulated since the style was last computed */
guint invalid :1; /* set if node or a child is invalid */
};
struct _GtkCssNodeClass

View File

@ -31,15 +31,6 @@
G_DEFINE_TYPE (GtkCssWidgetNode, gtk_css_widget_node, GTK_TYPE_CSS_NODE)
static void
gtk_css_widget_node_invalidate (GtkCssNode *node,
GtkCssChange change)
{
GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (node);
widget_node->pending_changes |= change;
}
static void
gtk_css_widget_node_set_invalid (GtkCssNode *node,
gboolean invalid)
@ -86,9 +77,6 @@ gtk_css_widget_node_validate (GtkCssNode *node,
GtkBitmask *changes;
GtkCssStyle *style;
change |= widget_node->pending_changes;
widget_node->pending_changes = 0;
if (widget_node->widget == NULL)
return _gtk_bitmask_new ();
@ -218,7 +206,6 @@ gtk_css_widget_node_class_init (GtkCssWidgetNodeClass *klass)
{
GtkCssNodeClass *node_class = GTK_CSS_NODE_CLASS (klass);
node_class->invalidate = gtk_css_widget_node_invalidate;
node_class->validate = gtk_css_widget_node_validate;
node_class->set_invalid = gtk_css_widget_node_set_invalid;
node_class->create_widget_path = gtk_css_widget_node_create_widget_path;

View File

@ -38,8 +38,6 @@ struct _GtkCssWidgetNode
GtkCssNode node;
GtkWidget *widget;
GtkCssChange pending_changes;
};
struct _GtkCssWidgetNodeClass