[gtk] rendernode: Add can_diff implementation for transform nodes



commit 18da852e15d0d1159da170ccd8c7d8d62233d171
Author: Benjamin Otte <otte redhat com>
Date:   Wed Mar 6 12:39:56 2019 +0100

    rendernode: Add can_diff implementation for transform nodes
    
    That one was missing and killing performance in the fishbowl.

 gsk/gskrendernodeimpl.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index 7fa58c4db3..5e7ade0a20 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -2427,6 +2427,19 @@ gsk_transform_node_draw (GskRenderNode *node,
   gsk_render_node_draw (self->child, cr);
 }
 
+static gboolean
+gsk_transform_node_can_diff (GskRenderNode *node1,
+                             GskRenderNode *node2)
+{
+  GskTransformNode *self1 = (GskTransformNode *) node1;
+  GskTransformNode *self2 = (GskTransformNode *) node2;
+
+  if (!gsk_transform_equal (self1->transform, self2->transform))
+    return FALSE;
+
+  return gsk_render_node_can_diff (self1->child, self2->child);
+}
+
 static void
 gsk_transform_node_diff (GskRenderNode  *node1,
                          GskRenderNode  *node2,
@@ -2563,7 +2576,7 @@ static const GskRenderNodeClass GSK_TRANSFORM_NODE_CLASS = {
   "GskTransformNode",
   gsk_transform_node_finalize,
   gsk_transform_node_draw,
-  gsk_render_node_can_diff_true,
+  gsk_transform_node_can_diff,
   gsk_transform_node_diff,
   gsk_transform_node_serialize,
   gsk_transform_node_deserialize


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