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



commit e3037c573db866845e24ad60774d18ae3e0eb7f9
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]