[gtk+/wip/cssnode3: 60/102] cssnode: Propagate pending changes after recomputing new style
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssnode3: 60/102] cssnode: Propagate pending changes after recomputing new style
- Date: Wed, 11 Mar 2015 00:21:27 +0000 (UTC)
commit 25d13b57f84bd574ea898001d30cbaa7b6fa32b9
Author: Benjamin Otte <otte redhat com>
Date: Wed Feb 18 05:55:38 2015 +0100
cssnode: Propagate pending changes after recomputing new style
This way we can propagate if the new style actually changed anything.
gtk/gtkcssnode.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 3a317cd..de7700e 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -575,11 +575,12 @@ gtk_css_node_ensure_style (GtkCssNode *cssnode)
if (cssnode->previous_sibling)
gtk_css_node_ensure_style (cssnode->previous_sibling);
- gtk_css_node_propagate_pending_changes (cssnode);
-
new_style = GTK_CSS_NODE_GET_CLASS (cssnode)->update_style (cssnode,
cssnode->pending_changes,
cssnode->style);
+
+ gtk_css_node_propagate_pending_changes (cssnode);
+
if (new_style)
{
gtk_css_node_set_style (cssnode, new_style);
@@ -771,7 +772,6 @@ gtk_css_node_validate (GtkCssNode *cssnode,
gint64 timestamp,
gboolean parent_changed)
{
- GtkCssChange change;
GtkCssNode *child;
GtkCssStyle *new_style;
gboolean changed;
@@ -789,20 +789,16 @@ gtk_css_node_validate (GtkCssNode *cssnode,
* the time.
*/
if (G_UNLIKELY (gtk_get_debug_flags () & GTK_DEBUG_NO_CSS_CACHE))
- change = GTK_CSS_CHANGE_ANY;
+ cssnode->pending_changes |= GTK_CSS_CHANGE_ANY;
- gtk_css_node_propagate_pending_changes (cssnode);
-
- if (!cssnode->invalid && change == 0 && !parent_changed)
+ if (!cssnode->invalid && cssnode->pending_changes == 0 && !parent_changed)
return;
gtk_css_node_set_invalid (cssnode, FALSE);
- change = cssnode->pending_changes;
- cssnode->pending_changes = 0;
cssnode->style_is_invalid = FALSE;
- new_style = GTK_CSS_NODE_GET_CLASS (cssnode)->validate (cssnode, cssnode->style, timestamp, change,
parent_changed);
+ new_style = GTK_CSS_NODE_GET_CLASS (cssnode)->validate (cssnode, cssnode->style, timestamp,
cssnode->pending_changes, parent_changed);
if (new_style)
{
gtk_css_node_set_style (cssnode, new_style);
@@ -814,6 +810,9 @@ gtk_css_node_validate (GtkCssNode *cssnode,
changed = FALSE;
}
+ gtk_css_node_propagate_pending_changes (cssnode);
+ cssnode->pending_changes = 0;
+
for (child = gtk_css_node_get_first_child (cssnode);
child;
child = gtk_css_node_get_next_sibling (child))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]