testsuite: Add a test for proper depth handling

Create a 16bit texture with a color values of
  color(srgb 0.999 0 0)
And then check that diffing it with a color node with that same color
returns black.
A color-matrix node has been added to multiply the difference so that it
can't escape due to being < 1/255.
This commit is contained in:
Benjamin Otte 2024-08-16 06:27:24 +02:00
parent fc3bd7894e
commit 88e8e01156
3 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,18 @@
color-matrix {
matrix: matrix3d(65535, 0, 0, 0, 0, 65535, 0, 0, 0, 0, 65535, 0, 0, 0, 0, 1);
child: blend {
mode: difference;
bottom: texture {
bounds: 0 0 10 10;
texture: url("data:image/png;base64,\
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKEAYAAADdohP+AAAAAXNSR0IArs4c6QAAAARjSUNQAQ0A\
AZxpOzIAAAAfSURBVCiRY/w/n4GBgeH/fwYqASZqGTRq4KiBg8lAAH3dA7DFgV4pAAAAAElFTkSu\
QmCC\
");
}
top: color {
bounds: 0 0 10 10;
color: color(srgb 0.999 0 0);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

View File

@ -31,6 +31,7 @@ compare_render_tests = [
'border-zero-width-color',
'borders-rotated',
'borders-scaled',
'bug-rgba8-offscreen-in-high-depth',
'clip-contained',
'clip-coordinates-2d',
'clip-coordinates-nocairo',