diff options
author | Benjamin Otte <otte@redhat.com> | 2015-02-28 02:22:38 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-03-18 15:23:33 +0100 |
commit | d785820c53a165dadd2eb3fa1059846b9e336f0a (patch) | |
tree | dd6bb06a3b488be62a8d12969557339dd0fd7156 /gtk/gtkcssnode.c | |
parent | 759d8dafd99d47466aaffc355906955a0c658005 (diff) | |
download | gtk+-d785820c53a165dadd2eb3fa1059846b9e336f0a.tar.gz |
cssnode: Change the way we invalidate timestamps
Do not propagate the TIMESTAMP change through the node tree, as that
causes lots of uneeded markings of nodes as invalid.
Instead, walk the node tree and find the nodes that have a non-static
style and only invalidate timestamps on those.
Diffstat (limited to 'gtk/gtkcssnode.c')
-rw-r--r-- | gtk/gtkcssnode.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c index 297068b486..547cfb91c9 100644 --- a/gtk/gtkcssnode.c +++ b/gtk/gtkcssnode.c @@ -841,6 +841,23 @@ gtk_css_node_invalidate_style_provider (GtkCssNode *cssnode) } } +static void +gtk_css_node_invalidate_timestamp (GtkCssNode *cssnode) +{ + GtkCssNode *child; + + if (!cssnode->invalid) + return; + + if (!gtk_css_style_is_static (cssnode->style)) + gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_TIMESTAMP); + + for (child = cssnode->first_child; child; child = child->next_sibling) + { + gtk_css_node_invalidate_timestamp (child); + } +} + void gtk_css_node_invalidate_frame_clock (GtkCssNode *cssnode, gboolean just_timestamp) @@ -849,10 +866,10 @@ gtk_css_node_invalidate_frame_clock (GtkCssNode *cssnode, if (cssnode->parent) return; - if (just_timestamp) - gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_TIMESTAMP); - else - gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_TIMESTAMP | GTK_CSS_CHANGE_ANIMATIONS); + gtk_css_node_invalidate_timestamp (cssnode); + + if (!just_timestamp) + gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_ANIMATIONS); } void |