From c9b83dfa1dc3fe83c570458acb403f1f4485f7c8 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 24 Oct 2023 01:32:46 +0200 Subject: [PATCH] testsuite: Add a test for texture-scale filters Check that the right filter is chosen and that that filter is implemented correctly. The test is disabled for Cairo because Cairo (or rather Pixman) doesn't follow the filtering specifications for GL/Vulkan and in particular the nearest filter picks a different pixel. --- .../gsk/compare/texture-scale-filters-3d.node | 30 ++++++++++++++++++ .../gsk/compare/texture-scale-filters-3d.png | Bin 0 -> 295 bytes testsuite/gsk/meson.build | 1 + 3 files changed, 31 insertions(+) create mode 100644 testsuite/gsk/compare/texture-scale-filters-3d.node create mode 100644 testsuite/gsk/compare/texture-scale-filters-3d.png diff --git a/testsuite/gsk/compare/texture-scale-filters-3d.node b/testsuite/gsk/compare/texture-scale-filters-3d.node new file mode 100644 index 0000000000..040da4b221 --- /dev/null +++ b/testsuite/gsk/compare/texture-scale-filters-3d.node @@ -0,0 +1,30 @@ +texture-scale { + bounds: 4 4 24 24; + filter: nearest; + texture: "texture1" url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJ0lEQVQYlWNkYPjwnwEPYMInSbqC\ +AwwCDAcYBPCb4HAAlc9Ie0cCAB8uBo20gfbVAAAAAElFTkSuQmCC\ +"); +} +repeat { + bounds: 32 0 32 32; + child: texture-scale { + bounds: 0 0 1 1; + filter: nearest; + texture: "texture1"; + } +} +repeat { + bounds: 0 32 32 32; + child: texture-scale { + bounds: 0 0 1 1; + texture: "texture1"; + } +} +repeat { + bounds: 32 32 32 32; + child: texture-scale { + bounds: 0 0 1 1; + filter: trilinear; + texture: "texture1"; + } +} diff --git a/testsuite/gsk/compare/texture-scale-filters-3d.png b/testsuite/gsk/compare/texture-scale-filters-3d.png new file mode 100644 index 0000000000000000000000000000000000000000..b3af8ab632e1985b1349d088b0fc83a6ae8e92ee GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=?>t=`Ln`LHy>XE9kb?-@!`=u7 zuZ=9XH*tG=@rNa_zjRp7DDL9?iS?fS_BV>wJo*#vF3eo^ZPM-ePoB9eFm7ph_GhO_ z{vY4I!`t5f@BJh^fg#FaG86~fIXriNVI3^J`}K9R^^*jr%y0O_`0p3Xw3y{j58vAU z*8eA`hWvtJle<4H=4cywGi5OP!thUqxtkAceD`+yvOg>;4PqB~zIWU9+>!I&S*r%J eRE