Skip to content

Commit dcb6f54

Browse files
committed
Bug 1918181 - Add wrench tests for snapshots with filters. r=gfx-reviewers,gw
Differential Revision: https://phabricator.services.mozilla.com/D231939
1 parent 2ce3b01 commit dcb6f54

File tree

5 files changed

+632
-0
lines changed

5 files changed

+632
-0
lines changed

wrench/reftests/image/reftest.list

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ fuzzy(1,160000) == image-filter-stretch-tile.yaml green-alpha-ref.yaml
2222
== snapshot-huge.yaml snapshot-huge-ref.yaml
2323
== snapshot-dependency.yaml snapshot-dependency-ref.yaml
2424
== snapshot-detached.yaml snapshot-detached-ref.yaml
25+
== snapshot-filters-01.yaml snapshot-filters-01-ref.yaml
26+
== snapshot-filters-02.yaml snapshot-filters-02-ref.yaml
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
---
2+
root:
3+
items:
4+
- type: stacking-context
5+
bounds: [10, 10, 200, 200]
6+
filters: blur(4, 4)
7+
items:
8+
- type: rect
9+
bounds: [10, 10, 80, 80]
10+
color: [0, 150, 0]
11+
- type: rect
12+
bounds: [5, 5, 40, 40]
13+
color: [200, 0, 0]
14+
15+
- type: stacking-context
16+
bounds: [110, 10, 200, 200]
17+
filters: brightness(0.5)
18+
items:
19+
- type: rect
20+
bounds: [10, 10, 80, 80]
21+
color: [0, 150, 0]
22+
- type: rect
23+
bounds: [5, 5, 40, 40]
24+
color: [200, 0, 0]
25+
26+
- type: stacking-context
27+
bounds: [210, 10, 200, 200]
28+
filters: contrast(0.5)
29+
items:
30+
- type: rect
31+
bounds: [10, 10, 80, 80]
32+
color: [0, 150, 0]
33+
- type: rect
34+
bounds: [5, 5, 40, 40]
35+
color: [200, 0, 0]
36+
37+
- type: stacking-context
38+
bounds: [310, 10, 200, 200]
39+
filters: hue-rotate(100)
40+
items:
41+
- type: rect
42+
bounds: [10, 10, 80, 80]
43+
color: [0, 150, 0]
44+
- type: rect
45+
bounds: [5, 5, 40, 40]
46+
color: [200, 0, 0]
47+
48+
- type: stacking-context
49+
bounds: [410, 10, 200, 200]
50+
filters: invert(1.0)
51+
items:
52+
- type: rect
53+
bounds: [10, 10, 80, 80]
54+
color: [0, 150, 0]
55+
- type: rect
56+
bounds: [5, 5, 40, 40]
57+
color: [200, 0, 0]
58+
59+
- type: stacking-context
60+
bounds: [510, 10, 200, 200]
61+
filters: opacity(0.5)
62+
items:
63+
- type: rect
64+
bounds: [10, 10, 80, 80]
65+
color: [0, 150, 0]
66+
- type: rect
67+
bounds: [5, 5, 40, 40]
68+
color: [200, 0, 0]
69+
70+
- type: stacking-context
71+
bounds: [610, 10, 200, 200]
72+
filters: saturate(0.1)
73+
items:
74+
- type: rect
75+
bounds: [10, 10, 80, 80]
76+
color: [0, 150, 0]
77+
- type: rect
78+
bounds: [5, 5, 40, 40]
79+
color: [200, 0, 0]
80+
81+
- type: stacking-context
82+
bounds: [710, 10, 200, 200]
83+
filters: sepia(1.0)
84+
items:
85+
- type: rect
86+
bounds: [10, 10, 80, 80]
87+
color: [0, 150, 0]
88+
- type: rect
89+
bounds: [5, 5, 40, 40]
90+
color: [200, 0, 0]
91+
92+
93+
94+
- type: stacking-context
95+
bounds: [10, 110, 200, 200]
96+
filters: blur(4, 4)
97+
items:
98+
- type: rect
99+
bounds: [10, 10, 80, 80]
100+
color: [0, 150, 0]
101+
- type: rect
102+
bounds: [5, 5, 40, 40]
103+
color: [200, 0, 0]
104+
105+
- type: stacking-context
106+
bounds: [110, 110, 200, 200]
107+
filters: brightness(0.5)
108+
items:
109+
- type: rect
110+
bounds: [10, 10, 80, 80]
111+
color: [0, 150, 0]
112+
- type: rect
113+
bounds: [5, 5, 40, 40]
114+
color: [200, 0, 0]
115+
116+
- type: stacking-context
117+
bounds: [210, 110, 200, 200]
118+
filters: contrast(0.5)
119+
items:
120+
- type: rect
121+
bounds: [10, 10, 80, 80]
122+
color: [0, 150, 0]
123+
- type: rect
124+
bounds: [5, 5, 40, 40]
125+
color: [200, 0, 0]
126+
127+
- type: stacking-context
128+
bounds: [310, 110, 200, 200]
129+
filters: hue-rotate(100)
130+
items:
131+
- type: rect
132+
bounds: [10, 10, 80, 80]
133+
color: [0, 150, 0]
134+
- type: rect
135+
bounds: [5, 5, 40, 40]
136+
color: [200, 0, 0]
137+
138+
- type: stacking-context
139+
bounds: [410, 110, 200, 200]
140+
filters: invert(1.0)
141+
items:
142+
- type: rect
143+
bounds: [10, 10, 80, 80]
144+
color: [0, 150, 0]
145+
- type: rect
146+
bounds: [5, 5, 40, 40]
147+
color: [200, 0, 0]
148+
149+
- type: stacking-context
150+
bounds: [510, 110, 200, 200]
151+
filters: opacity(0.5)
152+
items:
153+
- type: rect
154+
bounds: [10, 10, 80, 80]
155+
color: [0, 150, 0]
156+
- type: rect
157+
bounds: [5, 5, 40, 40]
158+
color: [200, 0, 0]
159+
160+
- type: stacking-context
161+
bounds: [610, 110, 200, 200]
162+
filters: saturate(0.1)
163+
items:
164+
- type: rect
165+
bounds: [10, 10, 80, 80]
166+
color: [0, 150, 0]
167+
- type: rect
168+
bounds: [5, 5, 40, 40]
169+
color: [200, 0, 0]
170+
171+
- type: stacking-context
172+
bounds: [710, 110, 200, 200]
173+
filters: sepia(1.0)
174+
items:
175+
- type: rect
176+
bounds: [10, 10, 80, 80]
177+
color: [0, 150, 0]
178+
- type: rect
179+
bounds: [5, 5, 40, 40]
180+
color: [200, 0, 0]
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# This test case contains a row of simple snapshotted stacking
2+
# contexts with filters on them. Their snapshots are rendered
3+
# as images in a second row. The second row should look identical
4+
# to the first.
5+
---
6+
root:
7+
items:
8+
- type: stacking-context
9+
bounds: [10, 10, 200, 200]
10+
filters: blur(4, 4)
11+
snapshot:
12+
name: "snap-blur"
13+
area: [-10, -10, 120, 120]
14+
items:
15+
- type: rect
16+
bounds: [10, 10, 80, 80]
17+
color: [0, 150, 0]
18+
- type: rect
19+
bounds: [5, 5, 40, 40]
20+
color: [200, 0, 0]
21+
22+
- type: stacking-context
23+
bounds: [110, 10, 200, 200]
24+
filters: brightness(0.5)
25+
snapshot:
26+
name: "snap-brightness"
27+
area: [-10, -10, 120, 120]
28+
items:
29+
- type: rect
30+
bounds: [10, 10, 80, 80]
31+
color: [0, 150, 0]
32+
- type: rect
33+
bounds: [5, 5, 40, 40]
34+
color: [200, 0, 0]
35+
36+
- type: stacking-context
37+
bounds: [210, 10, 200, 200]
38+
filters: contrast(0.5)
39+
snapshot:
40+
name: "snap-contrast"
41+
area: [-10, -10, 120, 120]
42+
items:
43+
- type: rect
44+
bounds: [10, 10, 80, 80]
45+
color: [0, 150, 0]
46+
- type: rect
47+
bounds: [5, 5, 40, 40]
48+
color: [200, 0, 0]
49+
50+
- type: stacking-context
51+
bounds: [310, 10, 200, 200]
52+
filters: hue-rotate(100)
53+
snapshot:
54+
name: "snap-hue-rotate"
55+
area: [-10, -10, 120, 120]
56+
items:
57+
- type: rect
58+
bounds: [10, 10, 80, 80]
59+
color: [0, 150, 0]
60+
- type: rect
61+
bounds: [5, 5, 40, 40]
62+
color: [200, 0, 0]
63+
64+
- type: stacking-context
65+
bounds: [410, 10, 200, 200]
66+
filters: invert(1.0)
67+
snapshot:
68+
name: "snap-invert"
69+
area: [-10, -10, 120, 120]
70+
items:
71+
- type: rect
72+
bounds: [10, 10, 80, 80]
73+
color: [0, 150, 0]
74+
- type: rect
75+
bounds: [5, 5, 40, 40]
76+
color: [200, 0, 0]
77+
78+
- type: stacking-context
79+
bounds: [510, 10, 200, 200]
80+
filters: opacity(0.5)
81+
snapshot:
82+
name: "snap-opacity"
83+
area: [-10, -10, 120, 120]
84+
items:
85+
- type: rect
86+
bounds: [10, 10, 80, 80]
87+
color: [0, 150, 0]
88+
- type: rect
89+
bounds: [5, 5, 40, 40]
90+
color: [200, 0, 0]
91+
92+
- type: stacking-context
93+
bounds: [610, 10, 200, 200]
94+
filters: saturate(0.1)
95+
snapshot:
96+
name: "snap-saturate"
97+
area: [-10, -10, 120, 120]
98+
items:
99+
- type: rect
100+
bounds: [10, 10, 80, 80]
101+
color: [0, 150, 0]
102+
- type: rect
103+
bounds: [5, 5, 40, 40]
104+
color: [200, 0, 0]
105+
106+
- type: stacking-context
107+
bounds: [710, 10, 200, 200]
108+
filters: sepia(1.0)
109+
snapshot:
110+
name: "snap-sepia"
111+
area: [-10, -10, 120, 120]
112+
items:
113+
- type: rect
114+
bounds: [10, 10, 80, 80]
115+
color: [0, 150, 0]
116+
- type: rect
117+
bounds: [5, 5, 40, 40]
118+
color: [200, 0, 0]
119+
120+
- type: stacking-context
121+
bounds: [10, 110, 2000, 200]
122+
items:
123+
- image: snapshot(snap-blur)
124+
bounds: [-10, -10, 120, 120]
125+
- image: snapshot(snap-brightness)
126+
bounds: [90, -10, 120, 120]
127+
- image: snapshot(snap-contrast)
128+
bounds: [190, -10, 120, 120]
129+
- image: snapshot(snap-hue-rotate)
130+
bounds: [290, -10, 120, 120]
131+
- image: snapshot(snap-invert)
132+
bounds: [390, -10, 120, 120]
133+
- image: snapshot(snap-opacity)
134+
bounds: [490, -10, 120, 120]
135+
- image: snapshot(snap-saturate)
136+
bounds: [590, -10, 120, 120]
137+
- image: snapshot(snap-sepia)
138+
bounds: [690, -10, 120, 120]

0 commit comments

Comments
 (0)