From f43543165be4aa3a0732bcbd01559bb21e1f72b1 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 22 Feb 2015 06:19:33 +0100 Subject: [PATCH] cssnode: Add optimization Don't even try to propagate changes when we know there are none. --- gtk/gtkcssnode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c index cb2b43d62a..d6c2c40933 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))