From 1afc7a92107e0b3d3df0c7e6f0921a6fa8e8bb2b Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 14 Feb 2024 00:18:43 +0100 Subject: [PATCH] testsuite: Add a test for scaled texture clipping This tests that the result is suitably clipped for doing linear blending - the rightmost green pixel that is technically offscreen is blending into the red pixel and turning the test yellow. Cairo gets this wrong for some reason I didn't investigate. --- .../scaled-texture-scale-clip-nocairo.node | 16 ++++++++++++++++ .../scaled-texture-scale-clip-nocairo.png | Bin 0 -> 78 bytes testsuite/gsk/meson.build | 1 + 3 files changed, 17 insertions(+) create mode 100644 testsuite/gsk/compare/scaled-texture-scale-clip-nocairo.node create mode 100644 testsuite/gsk/compare/scaled-texture-scale-clip-nocairo.png diff --git a/testsuite/gsk/compare/scaled-texture-scale-clip-nocairo.node b/testsuite/gsk/compare/scaled-texture-scale-clip-nocairo.node new file mode 100644 index 0000000000..af51e5e501 --- /dev/null +++ b/testsuite/gsk/compare/scaled-texture-scale-clip-nocairo.node @@ -0,0 +1,16 @@ +clip { + clip: 35 1 2 2; + child: color-matrix { + matrix: matrix3d(1000, 0, 0, 0, 0, 1000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + child: transform { + transform: scale(8); + child: texture-scale { + bounds: 0 0 10 10; + filter: nearest; + texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAYAAAD0In+KAAAAEUlEQVQImWP4z8Dwn+E/w38AEPgD\ +/V+dao0AAAAASUVORK5CYII=\ +"); + } + } + } +} diff --git a/testsuite/gsk/compare/scaled-texture-scale-clip-nocairo.png b/testsuite/gsk/compare/scaled-texture-scale-clip-nocairo.png new file mode 100644 index 0000000000000000000000000000000000000000..c328dd89fb639b383b6bfb43116277bb35930a4b GIT binary patch literal 78 zcmeAS@N?(olHy`uVBq!ia0vp^Od!m`1|*BN@u~nRQBN1g5RRG2f6gEHF#n-FGqW(W a2m^yQH#6ggTKNv30tQc4KbLh*2~7Yw!VvBN literal 0 HcmV?d00001 diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index c7225d2045..9a70f40256 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -134,6 +134,7 @@ compare_render_tests = [ 'scaled-cairo', 'scaled-texture', 'scaled-texture-scale', + 'scaled-texture-scale-clip-nocairo', 'scale0-crash', 'shadow-behind', 'shadow-clip-contents',