[gtk+] Add another cross-fade reftest



commit 4db1a7541ae4b6da20c888a1aa356094f09e67eb
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 8 22:45:05 2017 -0400

    Add another cross-fade reftest

 testsuite/gsk/cross-fades.node    |  Bin 0 -> 983611 bytes
 testsuite/gsk/cross-fades.png     |  Bin 0 -> 39609 bytes
 testsuite/gsk/test-render-nodes.c |   34 ++++++++++++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/testsuite/gsk/cross-fades.node b/testsuite/gsk/cross-fades.node
new file mode 100644
index 0000000..e71ac23
Binary files /dev/null and b/testsuite/gsk/cross-fades.node differ
diff --git a/testsuite/gsk/cross-fades.png b/testsuite/gsk/cross-fades.png
new file mode 100644
index 0000000..d1fb39d
Binary files /dev/null and b/testsuite/gsk/cross-fades.png differ
diff --git a/testsuite/gsk/test-render-nodes.c b/testsuite/gsk/test-render-nodes.c
index 14dd5d9..f24ddb5 100644
--- a/testsuite/gsk/test-render-nodes.c
+++ b/testsuite/gsk/test-render-nodes.c
@@ -345,6 +345,39 @@ cross_fade (void)
   return container;
 }
 
+static GskRenderNode *
+cross_fades (void)
+{
+  GskRenderNode *child1;
+  GskRenderNode *child2;
+  GskRenderNode *node;
+  GskRenderNode *nodes[5];
+  GskRenderNode *container;
+  graphene_matrix_t matrix;
+  int i;
+
+  child1 = cairo2 ();
+  child2 = ducky ();
+
+  for (i = 0; i < 5; i++)
+    {
+      node = gsk_cross_fade_node_new (child1, child2, i / 4.0);
+      graphene_matrix_init_translate (&matrix, &(const graphene_point3d_t) { i* 210, 0, 0 });
+      nodes[i] = gsk_transform_node_new (node, &matrix);
+      gsk_render_node_unref (node);
+    }
+
+  gsk_render_node_unref (child1);
+  gsk_render_node_unref (child2);
+
+  container = gsk_container_node_new (nodes, 5);
+
+  for (i = 0; i < 5; i++)
+    gsk_render_node_unref (nodes[i]);
+
+  return container;
+}
+
 static const struct {
   const char *name;
   GskRenderNode * (* func) (void);
@@ -355,6 +388,7 @@ static const struct {
   { "blendmode.node", blendmode },
   { "cross-fade.node", cross_fade },
   { "blendmodes.node", blendmodes },
+  { "cross-fades.node", cross_fades },
 };
 
 /*** test setup ***/


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