From b80e33b209cb97f13a7119d78217ee0ab113d851 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 1 Jul 2024 20:24:23 +0200 Subject: [PATCH] testsuite: Add tests for empty mask children The compare tests use an empty container node, but running them with --replay ends up with empty nodes in snapshots due to how containers are replayed. Related: !7396 Related: #6761 --- testsuite/gsk/compare/mask-empty-mask.node | 35 ++++++++++++++++ testsuite/gsk/compare/mask-empty-mask.png | Bin 0 -> 106 bytes testsuite/gsk/compare/mask-empty-source.node | 41 +++++++++++++++++++ testsuite/gsk/compare/mask-empty-source.png | Bin 0 -> 102 bytes testsuite/gsk/meson.build | 2 + 5 files changed, 78 insertions(+) create mode 100644 testsuite/gsk/compare/mask-empty-mask.node create mode 100644 testsuite/gsk/compare/mask-empty-mask.png create mode 100644 testsuite/gsk/compare/mask-empty-source.node create mode 100644 testsuite/gsk/compare/mask-empty-source.png diff --git a/testsuite/gsk/compare/mask-empty-mask.node b/testsuite/gsk/compare/mask-empty-mask.node new file mode 100644 index 0000000000..7da4caac68 --- /dev/null +++ b/testsuite/gsk/compare/mask-empty-mask.node @@ -0,0 +1,35 @@ +mask { + source: color { + bounds: 0 0 40 40; + color: rgb(255,0,204); + } + mask: container { + } +} +mask { + mode: inverted-alpha; + source: color { + bounds: 0 50 40 40; + color: rgb(255,0,204); + } + mask: container { + } +} +mask { + mode: luminance; + source: color { + bounds: 50 0 40 40; + color: rgb(255,0,204); + } + mask: container { + } +} +mask { + mode: inverted-luminance; + source: color { + bounds: 50 50 40 40; + color: rgb(255,0,204); + } + mask: container { + } +} diff --git a/testsuite/gsk/compare/mask-empty-mask.png b/testsuite/gsk/compare/mask-empty-mask.png new file mode 100644 index 0000000000000000000000000000000000000000..e1515bcf6b25ab344490bede11c8ed0c5ed1c636 GIT binary patch literal 106 zcmeAS@N?(olHy`uVBq!ia0vp^8bBPy$P6Su+-iFQq}T#{LR^9Le}*%iy39L)EXI-` zzhDN3XE)M-93f8^#}JM4$q5pyF3tZH42nD$GS45klwj}M1(ap*boFyt=akR{0QKM- ANB{r; literal 0 HcmV?d00001 diff --git a/testsuite/gsk/compare/mask-empty-source.node b/testsuite/gsk/compare/mask-empty-source.node new file mode 100644 index 0000000000..d42a5df867 --- /dev/null +++ b/testsuite/gsk/compare/mask-empty-source.node @@ -0,0 +1,41 @@ +/* guarantee bounds */ +color { + color: transparent; + bounds: 0 0 90 90; +} + +mask { + source: container { + } + mask: color { + bounds: 0 0 40 40; + color: rgb(255,0,204); + } +} +mask { + mode: inverted-alpha; + source: container { + } + mask: color { + bounds: 0 50 40 40; + color: rgb(255,0,204); + } +} +mask { + mode: luminance; + source: container { + } + mask: color { + bounds: 50 0 40 40; + color: rgb(255,0,204); + } +} +mask { + mode: inverted-luminance; + source: container { + } + mask: color { + bounds: 50 50 40 40; + color: rgb(255,0,204); + } +} diff --git a/testsuite/gsk/compare/mask-empty-source.png b/testsuite/gsk/compare/mask-empty-source.png new file mode 100644 index 0000000000000000000000000000000000000000..a0bac28573b4cab42dad2895e50731a82de9e66f GIT binary patch literal 102 zcmeAS@N?(olHy`uVBq!ia0vp^Q6S973?!M-E;|A#<^Z1%S0KH-%JvqJVk`;r3ubV5 ub|VeQ5%hF%43UsbmSA0+Akx$1$jrbpiGfjR(?dm|B!j1`pUXO@geCyo2^IPP literal 0 HcmV?d00001 diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index 3bd336f856..fd5d744a6e 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -99,6 +99,8 @@ compare_render_tests = [ 'linear-gradient-with-64-colorstops', 'mask', 'mask-clipped-inverted-alpha', + 'mask-empty-mask', + 'mask-empty-source', 'mask-modes', 'mask-modes-in-opacity', 'mask-modes-with-alpha',