[gtk+/wip/cssnode3: 76/81] cssnode: Special-case TIMESTAMP invalidations



commit 73a3a3e161d69433c74c12bcab2bd481b5b12cb3
Author: Benjamin Otte <otte redhat com>
Date:   Wed Feb 25 18:25:01 2015 +0100

    cssnode: Special-case TIMESTAMP invalidations
    
    Only invalidate timestamps if the node is marked as invalid. We overload
    the meaning of "invalid" as "tracks timestamps".
    
    While I don't like the way this is written, it is an important
    optimization because 95+% of nodes don't animate so timestamps don't
    matter to them. But timestamps are invalidated 60x per second.

 gtk/gtkcssnode.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 03f378d..1b5c6f4 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -865,6 +865,12 @@ void
 gtk_css_node_invalidate (GtkCssNode   *cssnode,
                          GtkCssChange  change)
 {
+  if (!cssnode->invalid)
+    change &= ~GTK_CSS_CHANGE_TIMESTAMP;
+
+  if (change == 0)
+    return;
+
   cssnode->pending_changes |= change;
 
   GTK_CSS_NODE_GET_CLASS (cssnode)->invalidate (cssnode);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]