[gtk+/wip/cssnode3: 76/91] cssnode: Special-case TIMESTAMP invalidations
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssnode3: 76/91] cssnode: Special-case TIMESTAMP invalidations
- Date: Mon, 9 Mar 2015 14:11:53 +0000 (UTC)
commit 6a93cd362389792190f64126d37de78bb902b33e
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 585ead7..11200d8 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -860,6 +860,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]