testsuite: Add a test for mask out of bounds effects
authorBenjamin Otte <otte@redhat.com>
Mon, 3 Jul 2023 18:51:51 +0000 (20:51 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 3 Jul 2023 20:02:44 +0000 (22:02 +0200)
Inverted alpha masks have an effect on the source, even if the mask
doesn't cover the source at all - or worse, is completely clipped out.

The GL renderer handles this fine, but Cairo and Vulkan had
optimizations that got this wrong.

testsuite/gsk/compare/mask-clipped-inverted-alpha.node [new file with mode: 0644]
testsuite/gsk/compare/mask-clipped-inverted-alpha.png [new file with mode: 0644]
testsuite/gsk/meson.build

diff --git a/testsuite/gsk/compare/mask-clipped-inverted-alpha.node b/testsuite/gsk/compare/mask-clipped-inverted-alpha.node
new file mode 100644 (file)
index 0000000..c72328a
--- /dev/null
@@ -0,0 +1,14 @@
+clip {
+  clip: 0 0 40 40;
+  child: mask {
+    mode: inverted-alpha;
+    source: color {
+      bounds: 0 0 100 100;
+      color: rebeccapurple;
+    }
+    mask: color {
+      bounds: 40 40 60 60;
+      color: black;
+    }
+  }
+}
diff --git a/testsuite/gsk/compare/mask-clipped-inverted-alpha.png b/testsuite/gsk/compare/mask-clipped-inverted-alpha.png
new file mode 100644 (file)
index 0000000..2987324
Binary files /dev/null and b/testsuite/gsk/compare/mask-clipped-inverted-alpha.png differ
index 9317e3a3e149d21abea755c741ffd5f04647e540..e48e9a3a45d9ae8904508002a68120a664231f2d 100644 (file)
@@ -65,6 +65,7 @@ compare_render_tests = [
   'invalid-transform',
   'issue-3615',
   'mask',
+  'mask-clipped-inverted-alpha',
   'mask-modes',
   'mask-modes-with-alpha',
   'nested-rounded-clips',