From: Benjamin Otte Date: Mon, 3 Jul 2023 18:51:51 +0000 (+0200) Subject: testsuite: Add a test for mask out of bounds effects X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~77^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c179013790ff0b62533547272e2881246e5df8e4;p=gtk4.git testsuite: Add a test for mask out of bounds effects 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. --- diff --git a/testsuite/gsk/compare/mask-clipped-inverted-alpha.node b/testsuite/gsk/compare/mask-clipped-inverted-alpha.node new file mode 100644 index 0000000000..c72328abe7 --- /dev/null +++ b/testsuite/gsk/compare/mask-clipped-inverted-alpha.node @@ -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 index 0000000000..2987324675 Binary files /dev/null and b/testsuite/gsk/compare/mask-clipped-inverted-alpha.png differ diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index 9317e3a3e1..e48e9a3a45 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -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',