[gtk+/wip/cssnode3: 68/101] cssnode: Add optimization



commit 788c5fc0641913fe55bc37e1955eb1ea3234519e
Author: Benjamin Otte <otte redhat com>
Date:   Sun Feb 22 06:19:33 2015 +0100

    cssnode: Add optimization
    
    Don't even try to propagate changes when we know there are none.

 gtk/gtkcssnode.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index cb2b43d..d6c2c40 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -579,6 +579,9 @@ gtk_css_node_propagate_pending_changes (GtkCssNode *cssnode,
   if (style_changed)
     change |= GTK_CSS_CHANGE_PARENT_STYLE;
 
+  if (!cssnode->invalid && change == 0)
+    return;
+
   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]