Skip to content

Commit 9f97122

Browse files
committed
Bug 1918138 - Add a wrench test for snapshots with shadows. r=jnicol
Differential Revision: https://phabricator.services.mozilla.com/D233627
1 parent 062e2cc commit 9f97122

File tree

3 files changed

+139
-0
lines changed

3 files changed

+139
-0
lines changed

wrench/reftests/image/reftest.list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ fuzzy(1,160000) == image-filter-stretch-tile.yaml green-alpha-ref.yaml
2424
== snapshot-detached.yaml snapshot-detached-ref.yaml
2525
== snapshot-filters-01.yaml snapshot-filters-01-ref.yaml
2626
== snapshot-filters-02.yaml snapshot-filters-02-ref.yaml
27+
fuzzy(3,3000) == snapshot-shadow.yaml snapshot-shadow-ref.yaml
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
root:
3+
items:
4+
- type: stacking-context
5+
bounds: [10, 10, 200, 200]
6+
filters: drop-shadow([0, 0], 10, black)
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: drop-shadow([5, 5], 0, red)
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:
29+
- drop-shadow([4, 4], 4, red)
30+
- drop-shadow([6, 6], 4, green)
31+
- drop-shadow([8, 8], 4, blue)
32+
items:
33+
- type: rect
34+
bounds: [10, 10, 80, 80]
35+
color: [0, 150, 0]
36+
- type: rect
37+
bounds: [5, 5, 40, 40]
38+
color: [200, 0, 0]
39+
40+
41+
42+
43+
- type: stacking-context
44+
bounds: [10, 110, 200, 200]
45+
filters: drop-shadow([0, 0], 10, black)
46+
items:
47+
- type: rect
48+
bounds: [10, 10, 80, 80]
49+
color: [0, 150, 0]
50+
- type: rect
51+
bounds: [5, 5, 40, 40]
52+
color: [200, 0, 0]
53+
54+
- type: stacking-context
55+
bounds: [110, 110, 200, 200]
56+
filters: drop-shadow([5, 5], 0, red)
57+
items:
58+
- type: rect
59+
bounds: [10, 10, 80, 80]
60+
color: [0, 150, 0]
61+
- type: rect
62+
bounds: [5, 5, 40, 40]
63+
color: [200, 0, 0]
64+
65+
- type: stacking-context
66+
bounds: [210, 110, 200, 200]
67+
filters:
68+
- drop-shadow([4, 4], 4, red)
69+
- drop-shadow([6, 6], 4, green)
70+
- drop-shadow([8, 8], 4, blue)
71+
items:
72+
- type: rect
73+
bounds: [10, 10, 80, 80]
74+
color: [0, 150, 0]
75+
- type: rect
76+
bounds: [5, 5, 40, 40]
77+
color: [200, 0, 0]
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This test case contains a row of simple snapshotted stacking
2+
# contexts with drop shadows 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: drop-shadow([0, 0], 10, black)
11+
snapshot:
12+
name: "snap0"
13+
area: [-50, -50, 200, 200]
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: drop-shadow([5, 5], 0, red)
25+
snapshot:
26+
name: "snap1"
27+
area: [-50, -50, 200, 200]
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:
39+
- drop-shadow([4, 4], 4, red)
40+
- drop-shadow([6, 6], 4, green)
41+
- drop-shadow([8, 8], 4, blue)
42+
snapshot:
43+
name: "snap2"
44+
area: [-50, -50, 200, 200]
45+
items:
46+
- type: rect
47+
bounds: [10, 10, 80, 80]
48+
color: [0, 150, 0]
49+
- type: rect
50+
bounds: [5, 5, 40, 40]
51+
color: [200, 0, 0]
52+
53+
- type: stacking-context
54+
bounds: [10, 110, 2000, 200]
55+
items:
56+
- image: snapshot(snap0)
57+
bounds: [-50, -50, 200, 200]
58+
- image: snapshot(snap1)
59+
bounds: [50, -50, 200, 200]
60+
- image: snapshot(snap2)
61+
bounds: [150, -50, 200, 200]

0 commit comments

Comments
 (0)