testsuite: Add a test for opacity + color-matrix nodes

These are 2x2 combinations that:
1. Use a texture child node vs a color child node
   This should force an offscreen vs straight up use a texture.
2. Switch opacity and color-matrix
   Either put the color matrix into the opacity node or put the opacity
   into the color matrix.

This is worth testing because renderers often combine opacity into the
color matrix to avoid offscreens.

And they do that because applications often create faded out symbolic
images, which end up as a combination of these nodes.
This commit is contained in:
Benjamin Otte 2023-12-01 12:13:30 +01:00
parent abf942efe5
commit 19171c7a89
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,46 @@
opacity {
opacity: 0.4;
child: color-matrix {
matrix: matrix3d(0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1);
child: color {
bounds: 0 0 50 50;
color: rgb(255,0,0);
}
}
}
opacity {
opacity: 0.4;
child: color-matrix {
matrix: matrix3d(0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1);
child: texture {
bounds: 50 0 50 50;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAV0lEQVRoge3PAQ3AMAzAsH78Ofck\
Li26bATJszM7P3BuB3zFSI2RGiM1RmqM1BipMVJjpMZIjZEaIzVGaozUGKkxUmOkxkiNkRojNUZq\
jNQYqTFSY6TmBQexAmLPVmNqAAAAAElFTkSuQmCC\
");
}
}
}
color-matrix {
matrix: matrix3d(0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1);
child: opacity {
opacity: 0.4;
child: color {
bounds: 0 50 50 50;
color: rgb(255,0,0);
}
}
}
color-matrix {
matrix: matrix3d(0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1);
child: opacity {
opacity: 0.4;
child: texture {
bounds: 50 50 50 50;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAV0lEQVRoge3PAQ3AMAzAsH78Ofck\
Li26bATJszM7P3BuB3zFSI2RGiM1RmqM1BipMVJjpMZIjZEaIzVGaozUGKkxUmOkxkiNkRojNUZq\
jNQYqTFSY6TmBQexAmLPVmNqAAAAAElFTkSuQmCC\
");
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

View File

@ -74,6 +74,7 @@ compare_render_tests = [
'mask-texture-color-alpha',
'nested-rounded-clips',
'opacity_clip',
'opacity-colormatrix-combinations',
'opacity-overdraw',
'opacity-overlapping-children',
'outset_shadow_offset_both',