[gtk+] Add a transform node reftest



commit 49ab093f26cea292e56eff1db99ad6edc435a31f
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 8 23:19:35 2017 -0400

    Add a transform node reftest

 testsuite/gsk/test-render-nodes.c |   34 ++++++++++++++++++++++++++++++++++
 testsuite/gsk/transform.node      |  Bin 0 -> 183134 bytes
 testsuite/gsk/transform.png       |  Bin 0 -> 50871 bytes
 3 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/testsuite/gsk/test-render-nodes.c b/testsuite/gsk/test-render-nodes.c
index f24ddb5..0bae5f1 100644
--- a/testsuite/gsk/test-render-nodes.c
+++ b/testsuite/gsk/test-render-nodes.c
@@ -378,6 +378,39 @@ cross_fades (void)
   return container;
 }
 
+static GskRenderNode *
+transform (void)
+{
+  GskRenderNode *node;
+  GskRenderNode *nodes[10];
+  GskRenderNode *container;
+  graphene_matrix_t scale;
+  graphene_matrix_t translate;
+  graphene_matrix_t matrix;
+  graphene_vec3_t axis;
+  graphene_vec3_init (&axis, 0.0, 0.0, 1.0);
+  int i;
+
+  node = ducky ();
+
+  for (i = 0; i < 10; i++)
+    {
+      graphene_matrix_init_rotate (&scale, 20.0 * i, &axis);
+      graphene_matrix_init_translate (&translate, &(const graphene_point3d_t) { i* 110, 0, 0 });
+      graphene_matrix_multiply (&scale, &translate, &matrix);
+      nodes[i] = gsk_transform_node_new (node, &matrix);
+    }
+
+  container = gsk_container_node_new (nodes, 5);
+
+  for (i = 0; i < 10; i++)
+    gsk_render_node_unref (nodes[i]);
+
+  gsk_render_node_unref (node);
+
+  return container;
+}
+
 static const struct {
   const char *name;
   GskRenderNode * (* func) (void);
@@ -389,6 +422,7 @@ static const struct {
   { "cross-fade.node", cross_fade },
   { "blendmodes.node", blendmodes },
   { "cross-fades.node", cross_fades },
+  { "transform.node", transform },
 };
 
 /*** test setup ***/
diff --git a/testsuite/gsk/transform.node b/testsuite/gsk/transform.node
new file mode 100644
index 0000000..d2f3736
Binary files /dev/null and b/testsuite/gsk/transform.node differ
diff --git a/testsuite/gsk/transform.png b/testsuite/gsk/transform.png
new file mode 100644
index 0000000..5d54886
Binary files /dev/null and b/testsuite/gsk/transform.png differ


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