tests: Add more tests for texture scale nodes
authorMatthias Clasen <mclasen@redhat.com>
Mon, 13 Mar 2023 17:20:02 +0000 (18:20 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 14 Mar 2023 05:14:57 +0000 (01:14 -0400)
testsuite/gsk/compare/texture-scale-magnify-rotate.node [new file with mode: 0644]
testsuite/gsk/compare/texture-scale-magnify-rotate.png [new file with mode: 0644]
testsuite/gsk/meson.build
testsuite/gsk/nodeparser/texture-scale-filters.node [new file with mode: 0644]
testsuite/gsk/nodeparser/texture-scale-filters.ref.node [new file with mode: 0644]

diff --git a/testsuite/gsk/compare/texture-scale-magnify-rotate.node b/testsuite/gsk/compare/texture-scale-magnify-rotate.node
new file mode 100644 (file)
index 0000000..e50c8ba
--- /dev/null
@@ -0,0 +1,11 @@
+clip {
+  clip: 24995 24995 10 10;
+  child: transform {
+    transform: translate(25000, 25000) rotate(90) translate(-25000, -25000);
+    child: texture-scale {
+      texture: url("data:;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKElEQVQYlWNkYGD4z4AG/v/HEGJgwhDBAQZQIQs2hzMyMtLBauorBACQUgcSISWLRgAAAABJRU5ErkJggg==");
+      bounds: 0 0 50000 50000;
+      filter: nearest;
+    }
+  }
+}
diff --git a/testsuite/gsk/compare/texture-scale-magnify-rotate.png b/testsuite/gsk/compare/texture-scale-magnify-rotate.png
new file mode 100644 (file)
index 0000000..9feff7a
Binary files /dev/null and b/testsuite/gsk/compare/texture-scale-magnify-rotate.png differ
index 1ded899729186c5b600120f531198c91aaac2d11..ca8f8335898bc33cc8f323007f1b2381fb0c5901 100644 (file)
@@ -77,6 +77,7 @@ compare_render_tests = [
   'scaled-texture',
   'shadow-in-opacity',
   'texture-scale-magnify-10000x',
+  'texture-scale-magnify-rotate',
   'texture-scale-stripes',
   'texture-url',
   'transform-in-transform',
@@ -234,6 +235,8 @@ node_parser_tests = [
   'texture-fail.node',
   'texture-fail.ref.node',
   'texture-fail.ref.errors',
+  'texture-scale-filters.node',
+  'texture-scale-filters.ref.node',
   'texture-scale-unknown-filter.errors',
   'texture-scale-unknown-filter.node',
   'texture-scale-unknown-filter.ref.node',
diff --git a/testsuite/gsk/nodeparser/texture-scale-filters.node b/testsuite/gsk/nodeparser/texture-scale-filters.node
new file mode 100644 (file)
index 0000000..1aef466
--- /dev/null
@@ -0,0 +1,22 @@
+texture-scale {
+  texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
+  bounds: 0 0 50 50;
+}
+
+texture-scale {
+  texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
+  bounds: 0 0 50 50;
+  filter: linear;
+}
+
+texture-scale {
+  texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
+  bounds: 0 0 50 50;
+  filter: nearest;
+}
+
+texture-scale {
+  texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
+  bounds: 0 0 50 50;
+  filter: trilinear;
+}
diff --git a/testsuite/gsk/nodeparser/texture-scale-filters.ref.node b/testsuite/gsk/nodeparser/texture-scale-filters.ref.node
new file mode 100644 (file)
index 0000000..9570132
--- /dev/null
@@ -0,0 +1,26 @@
+texture-scale {
+  bounds: 0 0 50 50;
+  texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
+1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
+");
+}
+texture-scale {
+  bounds: 0 0 50 50;
+  texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
+1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
+");
+}
+texture-scale {
+  bounds: 0 0 50 50;
+  filter: nearest;
+  texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
+1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
+");
+}
+texture-scale {
+  bounds: 0 0 50 50;
+  filter: trilinear;
+  texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\
+1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\
+");
+}