summaryrefslogtreecommitdiffstats
path: root/gfx/wr/wrench/reftests/transforms
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/wr/wrench/reftests/transforms')
-rw-r--r--gfx/wr/wrench/reftests/transforms/big-axis-aligned-scale-ref.yaml6
-rw-r--r--gfx/wr/wrench/reftests/transforms/big-axis-aligned-scale.yaml10
-rw-r--r--gfx/wr/wrench/reftests/transforms/blank.yaml2
-rw-r--r--gfx/wr/wrench/reftests/transforms/border-scale-2.pngbin0 -> 4247 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/border-scale-2.yaml19
-rw-r--r--gfx/wr/wrench/reftests/transforms/border-scale-3.pngbin0 -> 4099 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/border-scale-3.yaml19
-rw-r--r--gfx/wr/wrench/reftests/transforms/border-scale-4.pngbin0 -> 4021 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/border-scale-4.yaml19
-rw-r--r--gfx/wr/wrench/reftests/transforms/border-scale.pngbin0 -> 4842 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/border-scale.yaml19
-rw-r--r--gfx/wr/wrench/reftests/transforms/border-zoom.pngbin0 -> 27652 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/border-zoom.yaml19
-rw-r--r--gfx/wr/wrench/reftests/transforms/clip-translate-ref.yaml6
-rw-r--r--gfx/wr/wrench/reftests/transforms/clip-translate.yaml21
-rw-r--r--gfx/wr/wrench/reftests/transforms/complex-preserve-3d.yaml24
-rw-r--r--gfx/wr/wrench/reftests/transforms/content-offset.pngbin0 -> 2121 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/content-offset.yaml18
-rw-r--r--gfx/wr/wrench/reftests/transforms/coord-system.pngbin0 -> 4246 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/coord-system.yaml24
-rw-r--r--gfx/wr/wrench/reftests/transforms/flatten-preserve-3d-root-ref.yaml6
-rw-r--r--gfx/wr/wrench/reftests/transforms/flatten-preserve-3d-root.yaml23
-rw-r--r--gfx/wr/wrench/reftests/transforms/flatten-twice-ref.yaml6
-rw-r--r--gfx/wr/wrench/reftests/transforms/flatten-twice.yaml21
-rw-r--r--gfx/wr/wrench/reftests/transforms/image-rotated-clip.pngbin0 -> 3824 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/image-rotated-clip.yaml19
-rw-r--r--gfx/wr/wrench/reftests/transforms/image.pngbin0 -> 528 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/large-raster-root.yaml14
-rw-r--r--gfx/wr/wrench/reftests/transforms/local-clip.pngbin0 -> 2138 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/local-clip.yaml26
-rw-r--r--gfx/wr/wrench/reftests/transforms/near-plane-clip.pngbin0 -> 69765 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/near-plane-clip.yaml18
-rw-r--r--gfx/wr/wrench/reftests/transforms/nested-preserve-3d.pngbin0 -> 3793 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/nested-preserve-3d.yaml28
-rw-r--r--gfx/wr/wrench/reftests/transforms/nested-rotate-x-flat.pngbin0 -> 4539 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/nested-rotate-x-flat.yaml27
-rw-r--r--gfx/wr/wrench/reftests/transforms/nested-rotate-x.pngbin0 -> 3789 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/nested-rotate-x.yaml27
-rw-r--r--gfx/wr/wrench/reftests/transforms/non-inversible-world-rect.yaml23
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-border-radius.pngbin0 -> 11835 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-border-radius.yaml20
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-box-shadow-ref.yaml24
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-box-shadow.yaml23
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-clip-1.pngbin0 -> 2019 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-clip-1.yaml25
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-clip.pngbin0 -> 17224 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-clip.yaml27
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-mask.pngbin0 -> 2286 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-mask.yaml22
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-origin.pngbin0 -> 46679 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-origin.yaml16
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-shadow.pngbin0 -> 9496 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective-shadow.yaml27
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective.pngbin0 -> 128538 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/perspective.yaml54
-rw-r--r--gfx/wr/wrench/reftests/transforms/prim-suite.pngbin0 -> 49736 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/prim-suite.yaml45
-rw-r--r--gfx/wr/wrench/reftests/transforms/raster-root-huge-scale.yaml36
-rw-r--r--gfx/wr/wrench/reftests/transforms/raster-root-large-mask.yaml29
-rw-r--r--gfx/wr/wrench/reftests/transforms/raster-root-scaling-2-ref.yaml11
-rw-r--r--gfx/wr/wrench/reftests/transforms/raster-root-scaling-2.yaml22
-rw-r--r--gfx/wr/wrench/reftests/transforms/raster-root-scaling-ref.yaml10
-rw-r--r--gfx/wr/wrench/reftests/transforms/raster-root-scaling.yaml16
-rw-r--r--gfx/wr/wrench/reftests/transforms/raster_root_A_8192.yaml20
-rw-r--r--gfx/wr/wrench/reftests/transforms/raster_root_A_ref.yaml20
-rw-r--r--gfx/wr/wrench/reftests/transforms/raster_root_B_8192.yaml14
-rw-r--r--gfx/wr/wrench/reftests/transforms/raster_root_B_ref.yaml14
-rw-r--r--gfx/wr/wrench/reftests/transforms/reftest.list55
-rw-r--r--gfx/wr/wrench/reftests/transforms/rotate-clip-ref.yaml7
-rw-r--r--gfx/wr/wrench/reftests/transforms/rotate-clip.yaml18
-rw-r--r--gfx/wr/wrench/reftests/transforms/rotated-clip-large.pngbin0 -> 7418 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/rotated-clip-large.yaml17
-rw-r--r--gfx/wr/wrench/reftests/transforms/rotated-clip.pngbin0 -> 3789 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/rotated-clip.yaml17
-rw-r--r--gfx/wr/wrench/reftests/transforms/rotated-image.pngbin0 -> 7421 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/rotated-image.yaml75
-rw-r--r--gfx/wr/wrench/reftests/transforms/screen-space-blit-trivial.pngbin0 -> 74364 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/screen-space-blit-trivial.yaml22
-rw-r--r--gfx/wr/wrench/reftests/transforms/screen-space-blit.pngbin0 -> 72125 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/screen-space-blit.yaml22
-rw-r--r--gfx/wr/wrench/reftests/transforms/screen-space-blur.pngbin0 -> 231222 bytes
-rw-r--r--gfx/wr/wrench/reftests/transforms/screen-space-blur.yaml20
-rw-r--r--gfx/wr/wrench/reftests/transforms/segments-bug-ref.yaml24
-rw-r--r--gfx/wr/wrench/reftests/transforms/segments-bug.yaml27
-rw-r--r--gfx/wr/wrench/reftests/transforms/singular-ref.yaml28
-rw-r--r--gfx/wr/wrench/reftests/transforms/singular.yaml39
-rw-r--r--gfx/wr/wrench/reftests/transforms/snapped-preserve-3d-ref.yaml19
-rw-r--r--gfx/wr/wrench/reftests/transforms/snapped-preserve-3d.yaml21
-rw-r--r--gfx/wr/wrench/reftests/transforms/strange-w-ref.yaml12
-rw-r--r--gfx/wr/wrench/reftests/transforms/strange-w.yaml15
90 files changed, 1357 insertions, 0 deletions
diff --git a/gfx/wr/wrench/reftests/transforms/big-axis-aligned-scale-ref.yaml b/gfx/wr/wrench/reftests/transforms/big-axis-aligned-scale-ref.yaml
new file mode 100644
index 0000000000..357981c103
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/big-axis-aligned-scale-ref.yaml
@@ -0,0 +1,6 @@
+---
+root:
+ items:
+ - type: rect
+ bounds: [ 0, 0, 200, 44 ]
+ color: green
diff --git a/gfx/wr/wrench/reftests/transforms/big-axis-aligned-scale.yaml b/gfx/wr/wrench/reftests/transforms/big-axis-aligned-scale.yaml
new file mode 100644
index 0000000000..4dfb19fbb0
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/big-axis-aligned-scale.yaml
@@ -0,0 +1,10 @@
+---
+root:
+ items:
+ - type: stacking-context
+ transform-style: preserve-3d
+ transform: scale(-2, 44, 44727)
+ items:
+ - type: rect
+ bounds: [ -100, -100, 200, 101 ]
+ color: green
diff --git a/gfx/wr/wrench/reftests/transforms/blank.yaml b/gfx/wr/wrench/reftests/transforms/blank.yaml
new file mode 100644
index 0000000000..c4eb3ab673
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/blank.yaml
@@ -0,0 +1,2 @@
+---
+root:
diff --git a/gfx/wr/wrench/reftests/transforms/border-scale-2.png b/gfx/wr/wrench/reftests/transforms/border-scale-2.png
new file mode 100644
index 0000000000..04476e399a
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/border-scale-2.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/border-scale-2.yaml b/gfx/wr/wrench/reftests/transforms/border-scale-2.yaml
new file mode 100644
index 0000000000..f841033766
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/border-scale-2.yaml
@@ -0,0 +1,19 @@
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [50, 50, 100, 100]
+ transform: scale(0.5)
+ items:
+ - type: border
+ bounds: [ 100, 100, 400, 200 ]
+ width: [ 20, 20, 20, 20 ]
+ border-type: normal
+ style: solid
+ color: [ blue, blue, blue, blue ]
+ radius: {
+ top-left: [100, 100],
+ top-right: [100, 100],
+ bottom-left: [100, 100],
+ bottom-right: [100, 100],
+ }
diff --git a/gfx/wr/wrench/reftests/transforms/border-scale-3.png b/gfx/wr/wrench/reftests/transforms/border-scale-3.png
new file mode 100644
index 0000000000..c8f7b517a1
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/border-scale-3.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/border-scale-3.yaml b/gfx/wr/wrench/reftests/transforms/border-scale-3.yaml
new file mode 100644
index 0000000000..9308f2471d
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/border-scale-3.yaml
@@ -0,0 +1,19 @@
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [50, 50, 100, 100]
+ transform: [10,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]
+ items:
+ - type: border
+ bounds: [ 5, 50, 20, 100 ]
+ width: [ 10, 1, 10, 1 ]
+ border-type: normal
+ style: solid
+ color: blue
+ radius: {
+ top-left: [5, 50],
+ top-right: [5, 50],
+ bottom-left: [5, 50],
+ bottom-right: [5, 50],
+ }
diff --git a/gfx/wr/wrench/reftests/transforms/border-scale-4.png b/gfx/wr/wrench/reftests/transforms/border-scale-4.png
new file mode 100644
index 0000000000..7accbb30c2
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/border-scale-4.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/border-scale-4.yaml b/gfx/wr/wrench/reftests/transforms/border-scale-4.yaml
new file mode 100644
index 0000000000..b2e50bbd2c
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/border-scale-4.yaml
@@ -0,0 +1,19 @@
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [50, 50, 100, 100]
+ transform: [1,0,0,0, 0,10,0,0, 0,0,1,0, 0,0,0,1]
+ items:
+ - type: border
+ bounds: [ 50, 5, 200, 10 ]
+ width: [ 1, 10, 1, 10 ]
+ border-type: normal
+ style: solid
+ color: [ blue, blue, blue, blue ]
+ radius: {
+ top-left: [50, 5],
+ top-right: [50, 5],
+ bottom-left: [50, 5],
+ bottom-right: [50, 5],
+ }
diff --git a/gfx/wr/wrench/reftests/transforms/border-scale.png b/gfx/wr/wrench/reftests/transforms/border-scale.png
new file mode 100644
index 0000000000..3f9fae051b
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/border-scale.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/border-scale.yaml b/gfx/wr/wrench/reftests/transforms/border-scale.yaml
new file mode 100644
index 0000000000..4bf10c3029
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/border-scale.yaml
@@ -0,0 +1,19 @@
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [50, 50, 100, 100]
+ transform: scale(10)
+ items:
+ - type: border
+ bounds: [ 5, 5, 20, 10 ]
+ width: [ 1, 1, 1, 1 ]
+ border-type: normal
+ style: solid
+ color: [ blue, blue, blue, blue ]
+ radius: {
+ top-left: [5, 5],
+ top-right: [5, 5],
+ bottom-left: [5, 5],
+ bottom-right: [5, 5],
+ }
diff --git a/gfx/wr/wrench/reftests/transforms/border-zoom.png b/gfx/wr/wrench/reftests/transforms/border-zoom.png
new file mode 100644
index 0000000000..056e6ce728
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/border-zoom.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/border-zoom.yaml b/gfx/wr/wrench/reftests/transforms/border-zoom.yaml
new file mode 100644
index 0000000000..f3f472bf21
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/border-zoom.yaml
@@ -0,0 +1,19 @@
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [50, 50, 100, 100]
+ transform: rotate(-30)
+ items:
+ - type: border
+ bounds: [ 10, 10, 100, 100 ]
+ width: [ 10, 10, 10, 10 ]
+ border-type: normal
+ style: solid
+ color: [ red, green, blue, black ]
+ radius: {
+ top-left: [20, 20],
+ top-right: [10, 10],
+ bottom-left: [25, 25],
+ bottom-right: [0, 0],
+ }
diff --git a/gfx/wr/wrench/reftests/transforms/clip-translate-ref.yaml b/gfx/wr/wrench/reftests/transforms/clip-translate-ref.yaml
new file mode 100644
index 0000000000..412397d90f
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/clip-translate-ref.yaml
@@ -0,0 +1,6 @@
+---
+root:
+ items:
+ - type: rect
+ color: red
+ bounds: [6, 168, 18, 18]
diff --git a/gfx/wr/wrench/reftests/transforms/clip-translate.yaml b/gfx/wr/wrench/reftests/transforms/clip-translate.yaml
new file mode 100644
index 0000000000..3b278a14aa
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/clip-translate.yaml
@@ -0,0 +1,21 @@
+---
+root:
+ items:
+ -
+ type: "stacking-context"
+ transform: [0.75, 0, 0, 0, 0, 0.75, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
+ items:
+ -
+ type: "stacking-context"
+ transform: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 8, 224, 0, 1]
+ items:
+ - type: clip
+ bounds: [0, 0, 24, 24]
+ image-mask:
+ image: solid-color(255, 0, 0, 255, 24, 24)
+ rect: [0, 0, 24, 24]
+ repeat: false
+ items:
+ - type: rect
+ color: red
+ bounds: [0, 0, 24, 24]
diff --git a/gfx/wr/wrench/reftests/transforms/complex-preserve-3d.yaml b/gfx/wr/wrench/reftests/transforms/complex-preserve-3d.yaml
new file mode 100644
index 0000000000..9aa0884f62
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/complex-preserve-3d.yaml
@@ -0,0 +1,24 @@
+# the root sc should dominate backface-visibility and hide the rect
+
+---
+root:
+ items:
+ -
+ bounds: [300, 300, 300, 300]
+ clip-rect: [300, 300, 300, 300]
+ type: "stacking-context"
+ transform: rotate-y(180)
+ transform-style: flat
+ backface-visible: false
+ items:
+ -
+ type: "stacking-context"
+ transform-style: preserve-3d
+ backface-visible: true
+ items:
+ -
+ bounds: [350, 350, 150, 150]
+ clip-rect: [350, 350, 150, 150]
+ type: rect
+ color: 255 255 0 0.4000
+ backface-visible: true
diff --git a/gfx/wr/wrench/reftests/transforms/content-offset.png b/gfx/wr/wrench/reftests/transforms/content-offset.png
new file mode 100644
index 0000000000..16a39791b2
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/content-offset.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/content-offset.yaml b/gfx/wr/wrench/reftests/transforms/content-offset.yaml
new file mode 100644
index 0000000000..379b269fe6
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/content-offset.yaml
@@ -0,0 +1,18 @@
+---
+root:
+ items:
+ -
+ type: "stacking-context"
+ perspective: 1000
+ perspective-origin: 0 0
+ "transform-style": "preserve-3d"
+ items:
+ -
+ type: "stacking-context"
+ transform: rotate-x(-45) translate(100, 100, 0)
+ "transform-style": "preserve-3d"
+ items:
+ -
+ bounds: [0, 0, 200, 200]
+ type: rect
+ color: red
diff --git a/gfx/wr/wrench/reftests/transforms/coord-system.png b/gfx/wr/wrench/reftests/transforms/coord-system.png
new file mode 100644
index 0000000000..e3617f4194
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/coord-system.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/coord-system.yaml b/gfx/wr/wrench/reftests/transforms/coord-system.yaml
new file mode 100644
index 0000000000..6da2117056
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/coord-system.yaml
@@ -0,0 +1,24 @@
+---
+root:
+ items:
+ -
+ type: "stacking-context"
+ perspective: [1, 0, 0, 0, 0, 1, 0, 0, -0.102400005, -0.185, 1, -0.0005, 0, 0, 0, 1]
+ items:
+ -
+ type: "scroll-frame"
+ id: 2
+ "content-size": [1024, 740]
+ bounds: [0, 0, 1024, 740]
+ -
+ bounds: [0, 0, 1024, 200]
+ "clip-rect": [0, 0, 1024, 200]
+ "clip-and-scroll": 2
+ type: "stacking-context"
+ transform: [0.70710677, 0, -0.70710677, 0, 0, 1, 0, 0, 0.70710677, 0, 0.70710677, 0, 149.96133, 0, -937.9613, 1]
+ items:
+ -
+ bounds: [0, 0, 1024, 200]
+ "clip-rect": [0, 0, 1024, 200]
+ type: rect
+ color: 0 128 0 1.0000
diff --git a/gfx/wr/wrench/reftests/transforms/flatten-preserve-3d-root-ref.yaml b/gfx/wr/wrench/reftests/transforms/flatten-preserve-3d-root-ref.yaml
new file mode 100644
index 0000000000..5dbf829e02
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/flatten-preserve-3d-root-ref.yaml
@@ -0,0 +1,6 @@
+---
+root:
+ items:
+ - bounds: [100, 150, 150, 75]
+ type: rect
+ color: green
diff --git a/gfx/wr/wrench/reftests/transforms/flatten-preserve-3d-root.yaml b/gfx/wr/wrench/reftests/transforms/flatten-preserve-3d-root.yaml
new file mode 100644
index 0000000000..b3507a985a
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/flatten-preserve-3d-root.yaml
@@ -0,0 +1,23 @@
+# This test ensures that we flatten the trasformations (i.e. zero out Z coordinates)
+# at the boundaries of preserve-3d hierarchies.
+# If the stacking context isn't flattened at the preserve-3d boundary here,
+# it's non-zero Z component starts affecting the screen space position
+# due to the "rotate-x" transform at the top level.
+---
+root:
+ items:
+ -
+ bounds: [100, 100, 0, 0]
+ type: stacking-context
+ transform: rotate-x(60)
+ transform-style: flat
+ items:
+ -
+ type: "stacking-context"
+ transform: translate(0, 0, 200)
+ transform-style: preserve-3d
+ items:
+ -
+ bounds: [0, 0, 150, 150]
+ type: rect
+ color: green
diff --git a/gfx/wr/wrench/reftests/transforms/flatten-twice-ref.yaml b/gfx/wr/wrench/reftests/transforms/flatten-twice-ref.yaml
new file mode 100644
index 0000000000..27e4183555
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/flatten-twice-ref.yaml
@@ -0,0 +1,6 @@
+---
+root:
+ items:
+ - type: rect
+ bounds: [100, 100, 200, 100]
+ color: green
diff --git a/gfx/wr/wrench/reftests/transforms/flatten-twice.yaml b/gfx/wr/wrench/reftests/transforms/flatten-twice.yaml
new file mode 100644
index 0000000000..9af750a7c0
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/flatten-twice.yaml
@@ -0,0 +1,21 @@
+# This test ensures that we flatten the "flat" style trasformations.
+# If the flattening doesn't happen here, the rect gets rotated back
+# to the original position.
+---
+root:
+ items:
+ -
+ bounds: [100, 100, 0, 0]
+ type: stacking-context
+ transform: rotate-x(45)
+ transform-origin: 0 0
+ items:
+ -
+ type: "stacking-context"
+ transform: rotate-x(-45)
+ transform-origin: 0 0
+ items:
+ -
+ bounds: [0, 0, 200, 200]
+ type: rect
+ color: green
diff --git a/gfx/wr/wrench/reftests/transforms/image-rotated-clip.png b/gfx/wr/wrench/reftests/transforms/image-rotated-clip.png
new file mode 100644
index 0000000000..fda2872a3e
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/image-rotated-clip.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/image-rotated-clip.yaml b/gfx/wr/wrench/reftests/transforms/image-rotated-clip.yaml
new file mode 100644
index 0000000000..31803b5530
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/image-rotated-clip.yaml
@@ -0,0 +1,19 @@
+---
+root:
+ items:
+ -
+ bounds: [18, 18, 400, 400]
+ "clip-rect": [18, 18, 400, 400]
+ type: clip
+ id: 2
+ "content-size": [400, 400]
+ -
+ bounds: [0, 0, 0, 0]
+ "clip-and-scroll": 2
+ type: "stacking-context"
+ transform: [0.70710677, 0.70710677, 0, 0, -0.70710677, 0.70710677, 0, 0, 0, 0, 1, 0, 218, -64.84271, 0, 1]
+ items:
+ -
+ bounds: [0, 0, 400, 400]
+ "clip-rect": [0, 0, 400, 400]
+ image: solid-color(255, 0, 0, 255, 400, 400)
diff --git a/gfx/wr/wrench/reftests/transforms/image.png b/gfx/wr/wrench/reftests/transforms/image.png
new file mode 100644
index 0000000000..c8ec5aefcc
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/image.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/large-raster-root.yaml b/gfx/wr/wrench/reftests/transforms/large-raster-root.yaml
new file mode 100644
index 0000000000..0c5176d06d
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/large-raster-root.yaml
@@ -0,0 +1,14 @@
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [0, 0, 600, 600]
+ perspective: 20
+ items:
+ - type: stacking-context
+ transform: rotate-z(-45) rotate-x(-45)
+ filters: drop-shadow([0, 0], 10000, blue)
+ items:
+ - type: rect
+ bounds: [0, 0, 20000, 100]
+ color: green
diff --git a/gfx/wr/wrench/reftests/transforms/local-clip.png b/gfx/wr/wrench/reftests/transforms/local-clip.png
new file mode 100644
index 0000000000..92e25ec5e5
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/local-clip.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/local-clip.yaml b/gfx/wr/wrench/reftests/transforms/local-clip.yaml
new file mode 100644
index 0000000000..661b40bed7
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/local-clip.yaml
@@ -0,0 +1,26 @@
+---
+root:
+ items:
+ -
+ bounds: [0, 0, 1000, 1000]
+ "clip-rect": [0, 0, 1000, 1000]
+ type: clip
+ id: 3
+ "content-size": [1000, 1000]
+ -
+ bounds: [0, 0, 0, 0]
+ "clip-and-scroll": 3
+ type: "stacking-context"
+ transform: rotate(-45) translate(200, 200)
+ items:
+ -
+ bounds: [0, 0, 100, 100]
+ "clip-rect": [0, 0, 100, 100]
+ type: clip
+ id: 4
+ "content-size": [100, 100]
+ -
+ bounds: [2, -182, 152, 216]
+ "clip-rect": [2, 0, 152, 34]
+ "clip-and-scroll": 4
+ image: solid-color(255, 0, 0, 255, 100, 100)
diff --git a/gfx/wr/wrench/reftests/transforms/near-plane-clip.png b/gfx/wr/wrench/reftests/transforms/near-plane-clip.png
new file mode 100644
index 0000000000..f6bf5df777
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/near-plane-clip.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/near-plane-clip.yaml b/gfx/wr/wrench/reftests/transforms/near-plane-clip.yaml
new file mode 100644
index 0000000000..3bbafca974
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/near-plane-clip.yaml
@@ -0,0 +1,18 @@
+# Test the calculation for screen bounds for transformed primitives that cross the near plane.
+---
+root:
+ items:
+ -
+ bounds: [0, 0, 1000, 1000]
+ type: "stacking-context"
+ perspective: 200
+ items:
+ -
+ bounds: [0, 0, 1000, 1000]
+ type: "stacking-context"
+ transform: rotate-x(30)
+ items:
+ -
+ bounds: [350, 200, 260, 300]
+ image: checkerboard(2, 16, 16)
+ stretch-size: 260 260
diff --git a/gfx/wr/wrench/reftests/transforms/nested-preserve-3d.png b/gfx/wr/wrench/reftests/transforms/nested-preserve-3d.png
new file mode 100644
index 0000000000..686a22cf0a
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/nested-preserve-3d.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/nested-preserve-3d.yaml b/gfx/wr/wrench/reftests/transforms/nested-preserve-3d.yaml
new file mode 100644
index 0000000000..e7f0f05407
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/nested-preserve-3d.yaml
@@ -0,0 +1,28 @@
+---
+root:
+ items:
+ -
+ bounds: [260, 260, 231, 231]
+ "clip-rect": [260, 260, 231, 231]
+ type: border
+ width: 3
+ "border-type": normal
+ color: 0 0 255 1.0000
+ style: dashed
+ -
+ bounds: [300, 300, 0, 0]
+ "clip-rect": [300, 300, 0, 0]
+ type: "stacking-context"
+ transform: [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 75, -75, 1]
+ transform-style: preserve-3d
+ items:
+ -
+ type: "stacking-context"
+ transform: [1, 0, 0, 0, 0, 0.8660254, -0.5, 0, 0, 0.5, 0.8660254, 0, 0, 10.048096, 37.5, 1]
+ transform-style: preserve-3d
+ items:
+ -
+ bounds: [0, 0, 150, 150]
+ "clip-rect": [0, 0, 150, 150]
+ type: rect
+ color: 255 255 0 0.4000
diff --git a/gfx/wr/wrench/reftests/transforms/nested-rotate-x-flat.png b/gfx/wr/wrench/reftests/transforms/nested-rotate-x-flat.png
new file mode 100644
index 0000000000..ca33ca1336
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/nested-rotate-x-flat.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/nested-rotate-x-flat.yaml b/gfx/wr/wrench/reftests/transforms/nested-rotate-x-flat.yaml
new file mode 100644
index 0000000000..ed25c8f09d
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/nested-rotate-x-flat.yaml
@@ -0,0 +1,27 @@
+# This is the same as nested-rotate-x.yaml but without the preserve-3d.
+---
+root:
+ items:
+ -
+ bounds: [260, 260, 231, 231]
+ "clip-rect": [260, 260, 231, 231]
+ type: border
+ width: 3
+ "border-type": normal
+ color: 0 0 255 1.0000
+ style: dashed
+ -
+ bounds: [300, 300, 0, 0]
+ "clip-rect": [300, 300, 0, 0]
+ type: "stacking-context"
+ transform: [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 75, -75, 1]
+ items:
+ -
+ type: "stacking-context"
+ transform: [1, 0, 0, 0, 0, 0.8660254, -0.5, 0, 0, 0.5, 0.8660254, 0, 0, 10.048096, 37.5, 1]
+ items:
+ -
+ bounds: [0, 0, 150, 150]
+ "clip-rect": [0, 0, 150, 150]
+ type: rect
+ color: 255 255 0 0.4000
diff --git a/gfx/wr/wrench/reftests/transforms/nested-rotate-x.png b/gfx/wr/wrench/reftests/transforms/nested-rotate-x.png
new file mode 100644
index 0000000000..73ad1cec41
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/nested-rotate-x.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/nested-rotate-x.yaml b/gfx/wr/wrench/reftests/transforms/nested-rotate-x.yaml
new file mode 100644
index 0000000000..f1f8bd36c9
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/nested-rotate-x.yaml
@@ -0,0 +1,27 @@
+---
+root:
+ items:
+ -
+ bounds: [260, 260, 231, 231]
+ "clip-rect": [260, 260, 231, 231]
+ type: border
+ width: 3
+ "border-type": normal
+ color: 0 0 255 1.0000
+ style: dashed
+ -
+ bounds: [300, 300, 0, 0]
+ "clip-rect": [300, 300, 0, 0]
+ type: "stacking-context"
+ transform: [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 75, -75, 1]
+ transform-style: preserve-3d
+ items:
+ -
+ type: "stacking-context"
+ transform: [1, 0, 0, 0, 0, 0.8660254, -0.5, 0, 0, 0.5, 0.8660254, 0, 0, 10.048096, 37.5, 1]
+ items:
+ -
+ bounds: [0, 0, 150, 150]
+ "clip-rect": [0, 0, 150, 150]
+ type: rect
+ color: 255 255 0 0.4000
diff --git a/gfx/wr/wrench/reftests/transforms/non-inversible-world-rect.yaml b/gfx/wr/wrench/reftests/transforms/non-inversible-world-rect.yaml
new file mode 100644
index 0000000000..f94404f58e
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/non-inversible-world-rect.yaml
@@ -0,0 +1,23 @@
+# Tests that `get_raster_rects` raster -> world transform is inversible in general,
+# but one of the vertices of the world rectangles can't map back to the raster.
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: 0 0 400 400
+ perspective: 800
+ perspective-origin: 50% 200
+ items:
+ - type: stacking-context
+ bounds: 0 0 400 400
+ transform-style: preserve-3d
+ transform: rotate-z(40) translate(400, 200, 0)
+ margin: 100
+ items:
+ - type: stacking-context
+ bounds: 0 0 1000 1000
+ transform: rotate-y(-75) translate(0, 0, -500)
+ items:
+ - type: rect
+ bounds: [0, 0, 200, 200]
+ color: red
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-border-radius.png b/gfx/wr/wrench/reftests/transforms/perspective-border-radius.png
new file mode 100644
index 0000000000..bb401a837e
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-border-radius.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-border-radius.yaml b/gfx/wr/wrench/reftests/transforms/perspective-border-radius.yaml
new file mode 100644
index 0000000000..41b43cd48a
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-border-radius.yaml
@@ -0,0 +1,20 @@
+---
+root:
+ items:
+ -
+ bounds: [0, 0, 1000, 1000]
+ type: "stacking-context"
+ perspective: 256
+ items:
+ -
+ bounds: [128, 128, 256, 256]
+ type: "stacking-context"
+ transform: rotate-x(-60) rotate-y(-120)
+ items:
+ -
+ bounds: [128, 128, 256, 256]
+ type: rect
+ color: blue
+ complex-clip:
+ rect: [128, 128, 256, 256]
+ radius: [64, 32]
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-box-shadow-ref.yaml b/gfx/wr/wrench/reftests/transforms/perspective-box-shadow-ref.yaml
new file mode 100644
index 0000000000..36df831e19
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-box-shadow-ref.yaml
@@ -0,0 +1,24 @@
+---
+root:
+ items:
+ -
+ type: "stacking-context"
+ transform-style: "preserve-3d"
+ items:
+ -
+ type: "reference-frame"
+ transform: [1, 0, 0, 0, -0.20399817824363708, 0.05275486409664154, 0.9659258127212524, -0.0008049382013268769, -0.05466114357113838, -1.0211405754089355, 0.258819043636322, -0.00021568253578152508, 52.22355651855469, 242.49476623535156, -247.27700805664063, 1.206064224243164]
+ items:
+ -
+ type: "stacking-context"
+ items:
+ -
+ type: "box-shadow"
+ bounds: [30, 0, 507, 512]
+ box-bounds: [30, 0, 507, 512]
+ offset: [-14, 4]
+ blur-radius: 8
+ spread-radius: -4
+ border-radius: 256
+ clip-mode: "inset"
+ color: red
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-box-shadow.yaml b/gfx/wr/wrench/reftests/transforms/perspective-box-shadow.yaml
new file mode 100644
index 0000000000..99e247bf49
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-box-shadow.yaml
@@ -0,0 +1,23 @@
+---
+root:
+ items:
+ -
+ type: "stacking-context"
+ items:
+ -
+ type: "reference-frame"
+ transform: [1, 0, 0, 0, -0.20399817824363708, 0.05275486409664154, 0.9659258127212524, -0.0008049382013268769, -0.05466114357113838, -1.0211405754089355, 0.258819043636322, -0.00021568253578152508, 52.22355651855469, 242.49476623535156, -247.27700805664063, 1.206064224243164]
+ items:
+ -
+ type: "stacking-context"
+ items:
+ -
+ type: "box-shadow"
+ bounds: [30, 0, 507, 512]
+ box-bounds: [30, 0, 507, 512]
+ offset: [-14, 4]
+ blur-radius: 8
+ spread-radius: -4
+ border-radius: 256
+ clip-mode: "inset"
+ color: red
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-clip-1.png b/gfx/wr/wrench/reftests/transforms/perspective-clip-1.png
new file mode 100644
index 0000000000..2708424772
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-clip-1.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-clip-1.yaml b/gfx/wr/wrench/reftests/transforms/perspective-clip-1.yaml
new file mode 100644
index 0000000000..22220bbf29
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-clip-1.yaml
@@ -0,0 +1,25 @@
+---
+root:
+ items:
+ -
+ type: stacking-context
+ bounds: [0, 0, 0, 0]
+ perspective: [1, 0, 0, 0, 0, 1, 0, 0, -300, -250, 1, -0.5, 0, 0, 0, 1]
+ items:
+ -
+ bounds: [0, 0, 0, 0]
+ type: stacking-context
+ transform: [10, 0, 0, 0, 0, 10, 0, 0, 0, 0, 1, 0, -5382, -3222, -18, 1]
+ items:
+ -
+ bounds: [0, 0, 100, 100]
+ type: rect
+ color: red
+ -
+ bounds: [0, 0, 100, 100]
+ type: rect
+ color: green
+ complex-clip:
+ rect: [0, 0, 100, 100]
+ radius: 16
+
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-clip.png b/gfx/wr/wrench/reftests/transforms/perspective-clip.png
new file mode 100644
index 0000000000..b304ca7db5
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-clip.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-clip.yaml b/gfx/wr/wrench/reftests/transforms/perspective-clip.yaml
new file mode 100644
index 0000000000..ae905b8a44
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-clip.yaml
@@ -0,0 +1,27 @@
+# Test that a local space clip is correctly applied to
+# a primitive with a perspective transform.
+---
+root:
+ items:
+ - type: clip
+ bounds: [225, 200, 150, 200]
+ complex:
+ - rect: [225, 200, 150, 200]
+ radius: 32
+ items:
+ -
+ type: "stacking-context"
+ bounds: 0 0 1000 1000
+ perspective: 100
+ perspective-origin: 300 300
+ items:
+ -
+ type: "stacking-context"
+ transform: rotate-x(-10)
+ transform-origin: 300 300
+ filters: identity
+ items:
+ -
+ bounds: [200, 200, 200, 200]
+ image: checkerboard(2, 16, 12)
+ stretch-size: 200 200
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-mask.png b/gfx/wr/wrench/reftests/transforms/perspective-mask.png
new file mode 100644
index 0000000000..cffefbd5b2
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-mask.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-mask.yaml b/gfx/wr/wrench/reftests/transforms/perspective-mask.yaml
new file mode 100644
index 0000000000..eadc48e0ba
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-mask.yaml
@@ -0,0 +1,22 @@
+---
+root:
+ items:
+ -
+ type: "scroll-frame"
+ id: 2
+ "content-size": [500, 100]
+ bounds: [0, 0, 500, 100]
+ items:
+ -
+ type: "stacking-context"
+ perspective: 125
+ items:
+ -
+ type: "stacking-context"
+ bounds: [0, 0, 250, 100]
+ transform: rotate-y(54)
+ items:
+ -
+ bounds: [0, 0, 128, 128]
+ type: rect
+ color: red
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-origin.png b/gfx/wr/wrench/reftests/transforms/perspective-origin.png
new file mode 100644
index 0000000000..cd98b9e83a
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-origin.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-origin.yaml b/gfx/wr/wrench/reftests/transforms/perspective-origin.yaml
new file mode 100644
index 0000000000..ca5eb5f95c
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-origin.yaml
@@ -0,0 +1,16 @@
+---
+root:
+ items:
+ -
+ bounds: [0, 0, 1000, 1000]
+ type: "stacking-context"
+ perspective: 200
+ items:
+ -
+ bounds: [0, 0, 1000, 1000]
+ type: "stacking-context"
+ transform: rotate-x(-45)
+ items:
+ -
+ bounds: [350, 400, 260, 260]
+ image: checkerboard(2, 16, 16)
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-shadow.png b/gfx/wr/wrench/reftests/transforms/perspective-shadow.png
new file mode 100644
index 0000000000..07befbd35b
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-shadow.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/perspective-shadow.yaml b/gfx/wr/wrench/reftests/transforms/perspective-shadow.yaml
new file mode 100644
index 0000000000..8b8e7c87d2
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective-shadow.yaml
@@ -0,0 +1,27 @@
+---
+root:
+ items:
+ -
+ type: stacking-context
+ bounds: [0, 0, 0, 0]
+ transform: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 139, 0, 1]
+ items:
+ -
+ type: stacking-context
+ bounds: [0, 0, 0, 0]
+ perspective: [1, 0, 0, 0, 0, 1, 0, 0, -299, -250, 1, -0.5, 0, 0, 0, 1]
+ items:
+ -
+ bounds: [0, 0, 0, 0]
+ type: stacking-context
+ transform: [10, 0, 0, 0, 0, 10, 0, 0, 0, 0, 1, 0, -5382, -3222, -18, 1]
+ items:
+ -
+ type: box-shadow
+ bounds: [548, 200, 100, 100]
+ color: 0 0 0 0.7020
+ blur-radius: 20
+ -
+ bounds: [548, 200, 100, 100]
+ type: rect
+ color: 0 255 0 1.0000
diff --git a/gfx/wr/wrench/reftests/transforms/perspective.png b/gfx/wr/wrench/reftests/transforms/perspective.png
new file mode 100644
index 0000000000..79992dd892
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/perspective.yaml b/gfx/wr/wrench/reftests/transforms/perspective.yaml
new file mode 100644
index 0000000000..2ebd0899c6
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/perspective.yaml
@@ -0,0 +1,54 @@
+---
+root:
+ items:
+ -
+ type: "stacking-context"
+ items:
+ -
+ type: "stacking-context"
+ transform: [1, 0, 0, 0, -1.0606601, -0.35355338, 0.70710677, -0.0035355338, -1.0606601, -1.767767, 0.70710677, -0.0035355338, 306.06604, 335.35535, -70.71068, 1.3535534]
+ items:
+ -
+ bounds: [0, 0, 200, 200]
+ image: checkerboard(2, 16, 12)
+ stretch-size: 200 200
+ -
+ type: "stacking-context"
+ transform: [3.1819804, 1.0606601, -0.70710677, 0.0035355338, 0, 1, 0, 0, -1.7677668, -1.0606601, 0.70710677, -0.0035355338, 381.80194, 93.93398, 70.71068, 0.6464466]
+ items:
+ -
+ bounds: [0, 0, 200, 200]
+ image: checkerboard(2, 16, 12)
+ stretch-size: 200 200
+ -
+ type: "stacking-context"
+ transform: [3.182372, 1.088346, -0.4353384, 0.002176692, -1.0183089, 0.7350135, 0.10599462, -0.00052997307, -4.481691, -1.2350134, 0.89400536, -0.0044700266, 883.5937, 117.66405, 32.93438, 0.8353281]
+ items:
+ -
+ bounds: [0, 0, 200, 200]
+ image: checkerboard(2, 16, 12)
+ stretch-size: 200 200
+ -
+ type: "stacking-context"
+ transform: [0.29134378, -0.9896399, 0.6324555, -0.0015811388, 0.3543281, 1.4948199, -0.31622776, 0.0007905694, -1.1627856, -0.92120904, 0.70710677, -0.0017677669, 235.43283, 649.48206, -31.622776, 1.079057]
+ items:
+ -
+ bounds: [0, 0, 200, 200]
+ image: checkerboard(2, 16, 12)
+ stretch-size: 200 200
+ -
+ type: "stacking-context"
+ transform: [1, 0, 0, 0, 1, 1, 0, 0, -3.5, -3.5, 1, -0.005, 500, 600, 0, 1]
+ items:
+ -
+ bounds: [0, 0, 200, 200]
+ image: checkerboard(2, 16, 12)
+ stretch-size: 200 200
+ -
+ type: "stacking-context"
+ transform: [0.82903755, 0.78133285, 0, 0, -0.5591929, 0.67920226, 0, 0, -5.5, -3.5, 1, -0.005, 1073.0155, 553.9465, 0, 1]
+ items:
+ -
+ bounds: [0, 0, 200, 200]
+ image: checkerboard(2, 16, 12)
+ stretch-size: 200 200
diff --git a/gfx/wr/wrench/reftests/transforms/prim-suite.png b/gfx/wr/wrench/reftests/transforms/prim-suite.png
new file mode 100644
index 0000000000..131c3d4ac5
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/prim-suite.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/prim-suite.yaml b/gfx/wr/wrench/reftests/transforms/prim-suite.yaml
new file mode 100644
index 0000000000..241a2e1c0a
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/prim-suite.yaml
@@ -0,0 +1,45 @@
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [50, 50, 100, 100]
+ transform: rotate(-30)
+ items:
+ - type: rect
+ bounds: [ 10, 10, 80, 80 ]
+ color: [0, 255, 0]
+ - type: box-shadow
+ bounds: [ 10, 10, 80, 80 ]
+ blur-radius: 25
+ clip-mode: inset
+
+ - type: rect
+ bounds: [ 140, 10, 80, 80 ]
+ color: [0, 255, 0]
+ - type: box-shadow
+ bounds: [ 140, 10, 80, 80 ]
+ blur-radius: 25
+ clip-mode: outset
+
+ - type: border
+ bounds: [ 250, 10, 100, 100 ]
+ width: [ 10, 10, 10, 10 ]
+ border-type: normal
+ style: solid
+ color: [ red, green, blue, black ]
+ radius: {
+ top-left: [20, 20],
+ top-right: [10, 10],
+ bottom-left: [25, 25],
+ bottom-right: [0, 0],
+ }
+
+ - bounds: [150, 150, 128, 128]
+ image: checkerboard(4, 15, 8)
+ stretch-size: 128 128
+
+ - type: radial-gradient
+ bounds: 300 150 100 100
+ center: 50 50
+ radius: 50 50
+ stops: [0, red, 1, blue]
diff --git a/gfx/wr/wrench/reftests/transforms/raster-root-huge-scale.yaml b/gfx/wr/wrench/reftests/transforms/raster-root-huge-scale.yaml
new file mode 100644
index 0000000000..fd63c63031
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/raster-root-huge-scale.yaml
@@ -0,0 +1,36 @@
+# Tests that raster roots with very large scaling factors do not cause device rects to overflow.
+# See bug 1642440
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: 0 0 0 0
+ transform: perspective(1) scale(99999999)
+ transform-style: preserve-3d
+ filters: invert(1)
+ items:
+ - type: stacking-context
+ bounds: 0 0 0 0
+ transform: perspective(1) scale(0.0000001)
+ transform-style: preserve-3d
+ items:
+ - type: clip
+ bounds: [0, 0, 60000, 60000]
+ clip-rect: [0, 0, 60000, 60000]
+ id: 2
+ complex:
+ - rect: [0, 0, 100, 100]
+ radius: [20, 20]
+ "clip-mode": clip
+ - type: stacking-context
+ bounds: 0 0 0 0
+ clip-and-scroll: 2
+ items:
+ - rect: 0 0 100 100
+ color: red
+ - type: box-shadow
+ bounds: 0 0 100 100
+ color: blue
+ offset: 10 20
+ blur-radius: 10
+ border-radius: [ 20, 20, 20, 20 ]
diff --git a/gfx/wr/wrench/reftests/transforms/raster-root-large-mask.yaml b/gfx/wr/wrench/reftests/transforms/raster-root-large-mask.yaml
new file mode 100644
index 0000000000..4517f81651
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/raster-root-large-mask.yaml
@@ -0,0 +1,29 @@
+# Make sure we don't panic by trying to create an excessively large mask render task
+# See bug 1637796
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: 0 0 0 0
+ transform: perspective(300)
+ items:
+ - type: stacking-context
+ bounds: 0 0 0 0
+ transform-style: preserve-3d
+ transform: ["scale(0.001667, 0.001667)"]
+ items:
+ - type: clip
+ bounds: [10, 10, 60000, 60000]
+ clip-rect: [10, 10, 60000, 60000]
+ id: 2
+ complex:
+ - rect: [10, 10, 60000, 60000]
+ radius: [10000, 10000]
+ "clip-mode": clip
+ - type: stacking-context
+ bounds: 0 0 0 0
+ clip-and-scroll: 2
+ items:
+ - type: rect
+ bounds: 0 0 60000 60000
+ color: blue
diff --git a/gfx/wr/wrench/reftests/transforms/raster-root-scaling-2-ref.yaml b/gfx/wr/wrench/reftests/transforms/raster-root-scaling-2-ref.yaml
new file mode 100644
index 0000000000..925d81951e
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/raster-root-scaling-2-ref.yaml
@@ -0,0 +1,11 @@
+# Tests that the correct device pixel scale is propagated to child surfaces.
+# See bug 1639729
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [0, 0, 0, 0]
+ filters: invert(1)
+ items:
+ - image: checkerboard(2, 16, 16)
+ bounds: [0, 0, 260, 260]
diff --git a/gfx/wr/wrench/reftests/transforms/raster-root-scaling-2.yaml b/gfx/wr/wrench/reftests/transforms/raster-root-scaling-2.yaml
new file mode 100644
index 0000000000..6aebd744ce
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/raster-root-scaling-2.yaml
@@ -0,0 +1,22 @@
+# Tests that the correct device pixel scale is propagated to child surfaces.
+# See bug 1639729
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [0, 0, 0, 0]
+ # Force WebRender to form a raster root
+ transform: perspective(1000)
+ items:
+ - type: stacking-context
+ bounds: [0, 0, 0, 0]
+ transform-style: preserve-3d
+ transform: scale(10,10)
+ items:
+ - type: stacking-context
+ bounds: 0 0 0 0
+ # Create a non-raster root surface
+ filters: invert(1)
+ items:
+ - image: checkerboard(2, 16, 16)
+ bounds: [0, 0, 26, 26]
diff --git a/gfx/wr/wrench/reftests/transforms/raster-root-scaling-ref.yaml b/gfx/wr/wrench/reftests/transforms/raster-root-scaling-ref.yaml
new file mode 100644
index 0000000000..5088e01756
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/raster-root-scaling-ref.yaml
@@ -0,0 +1,10 @@
+
+# Tests that surfaces created by raster roots are scaled based on the surface to parent transform.
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [0, 0, 0, 0]
+ items:
+ - image: checkerboard(2, 16, 16)
+ bounds: [0, 0, 260, 260]
diff --git a/gfx/wr/wrench/reftests/transforms/raster-root-scaling.yaml b/gfx/wr/wrench/reftests/transforms/raster-root-scaling.yaml
new file mode 100644
index 0000000000..3a592635a3
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/raster-root-scaling.yaml
@@ -0,0 +1,16 @@
+# Tests that surfaces created by raster roots are scaled based on the surface to parent transform.
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [0, 0, 0, 0]
+ # Force WebRender to form a raster root
+ transform: perspective(1000)
+ items:
+ - type: stacking-context
+ bounds: [0, 0, 0, 0]
+ transform-style: preserve-3d
+ transform: scale(10,10)
+ items:
+ - image: checkerboard(2, 16, 16)
+ bounds: [0, 0, 26, 26]
diff --git a/gfx/wr/wrench/reftests/transforms/raster_root_A_8192.yaml b/gfx/wr/wrench/reftests/transforms/raster_root_A_8192.yaml
new file mode 100644
index 0000000000..034631d031
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/raster_root_A_8192.yaml
@@ -0,0 +1,20 @@
+root:
+ items:
+ - type: "stacking-context"
+ transform: scale(0.125)
+ items:
+ - type: "stacking-context"
+ perspective: 100
+ perspective-origin: 100 50
+ items:
+ - image: checkerboard(0, 512, 16);
+ bounds: [1600, 1600, 8192, 8192]
+ - type: "stacking-context"
+ bounds: [0, 0, 8192, 8192]
+ mix-blend-mode: difference
+ complex-clip:
+ rect: [2048, 2048, 4096, 4096]
+ radius: [1024, 1024]
+ items:
+ - image: checkerboard(0, 4096, 2);
+ bounds: [0, 0, 8192, 8192]
diff --git a/gfx/wr/wrench/reftests/transforms/raster_root_A_ref.yaml b/gfx/wr/wrench/reftests/transforms/raster_root_A_ref.yaml
new file mode 100644
index 0000000000..b5e28256bf
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/raster_root_A_ref.yaml
@@ -0,0 +1,20 @@
+root:
+ items:
+ - type: "stacking-context"
+ transform: scale(0.5)
+ items:
+ - type: "stacking-context"
+ perspective: 100
+ perspective-origin: 100 50
+ items:
+ - image: checkerboard(0, 128, 16);
+ bounds: 400 400 2048 2048
+ - type: "stacking-context"
+ bounds: [0, 0, 2048, 2048]
+ mix-blend-mode: difference
+ complex-clip:
+ rect: [512, 512, 1024, 1024]
+ radius: [256, 256]
+ items:
+ - image: checkerboard(0, 1024, 2);
+ bounds: [0, 0, 2048, 2048]
diff --git a/gfx/wr/wrench/reftests/transforms/raster_root_B_8192.yaml b/gfx/wr/wrench/reftests/transforms/raster_root_B_8192.yaml
new file mode 100644
index 0000000000..9f8a58f5cc
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/raster_root_B_8192.yaml
@@ -0,0 +1,14 @@
+root:
+ items:
+ - type: stacking-context
+ bounds: [0, 0, 600, 600]
+ perspective: 100
+ items:
+ - type: stacking-context
+ transform: rotate-z(20) rotate-x(60)
+ filters: [invert(1)]
+ mix-blend-mode: difference
+ items:
+ - type: rect
+ bounds: [0, 0, 20000, 100]
+ color: [20, 120, 18, 1.0]
diff --git a/gfx/wr/wrench/reftests/transforms/raster_root_B_ref.yaml b/gfx/wr/wrench/reftests/transforms/raster_root_B_ref.yaml
new file mode 100644
index 0000000000..3fea3a19db
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/raster_root_B_ref.yaml
@@ -0,0 +1,14 @@
+root:
+ items:
+ - type: stacking-context
+ bounds: [0, 0, 600, 600]
+ perspective: 100
+ items:
+ - type: stacking-context
+ transform: rotate-z(20) rotate-x(60)
+ filters: [invert(1)]
+ mix-blend-mode: difference
+ items:
+ - type: rect
+ bounds: [0, 0, 4000, 100]
+ color: [20, 120, 18, 1.0]
diff --git a/gfx/wr/wrench/reftests/transforms/reftest.list b/gfx/wr/wrench/reftests/transforms/reftest.list
new file mode 100644
index 0000000000..256b63e989
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/reftest.list
@@ -0,0 +1,55 @@
+platform(linux,mac) == local-clip.yaml local-clip.png
+platform(linux,mac) == rotated-clip.yaml rotated-clip.png
+platform(linux,mac) == rotated-clip-large.yaml rotated-clip-large.png
+platform(linux,mac) == image-rotated-clip.yaml image-rotated-clip.png
+# Something leaks the state: the test passes if only run `reftest reftests/transform`
+# but fails when all the tests are run
+platform(linux,mac) fuzzy(1,6) == rotated-image.yaml rotated-image.png
+== singular.yaml singular-ref.yaml
+platform(linux) fuzzy(1,630) == perspective.yaml perspective.png
+platform(linux,mac) fuzzy(1,156) == prim-suite.yaml prim-suite.png
+== segments-bug.yaml segments-bug-ref.yaml
+platform(linux,mac) == content-offset.yaml content-offset.png
+platform(linux,mac) == coord-system.yaml coord-system.png
+platform(linux,mac) fuzzy(1,15) zoom(4) == border-zoom.yaml border-zoom.png
+platform(linux) fuzzy(1,520) == perspective-origin.yaml perspective-origin.png
+platform(linux,mac) color_targets(3) alpha_targets(0) fuzzy(1,180) == screen-space-blit.yaml screen-space-blit.png
+platform(linux,mac) fuzzy(1,346) color_targets(2) alpha_targets(0) == screen-space-blit-trivial.yaml screen-space-blit-trivial.png
+platform(linux) fuzzy(11,4592) == screen-space-blur.yaml screen-space-blur.png
+platform(linux,mac) fuzzy(1,25) == nested-rotate-x.yaml nested-rotate-x.png
+platform(linux,mac) != nested-rotate-x.yaml nested-rotate-x-flat.yaml
+platform(linux,mac) fuzzy(1,25) == nested-rotate-x-flat.yaml nested-rotate-x-flat.png
+platform(linux,mac) fuzzy(1,25) == nested-preserve-3d.yaml nested-preserve-3d.png
+platform(linux,mac) fuzzy(1,283) == near-plane-clip.yaml near-plane-clip.png
+platform(linux,mac) == perspective-mask.yaml perspective-mask.png
+== rotate-clip.yaml rotate-clip-ref.yaml
+== clip-translate.yaml clip-translate-ref.yaml
+platform(linux,mac) fuzzy(1,1) == perspective-clip.yaml perspective-clip.png
+platform(linux,mac) fuzzy(1,2) == perspective-clip-1.yaml perspective-clip-1.png
+platform(linux,mac) fuzzy(1,2) == perspective-shadow.yaml perspective-shadow.png
+# The ref YAML here produces significantly worse quality
+fuzzy(200,4200) == perspective-box-shadow.yaml perspective-box-shadow-ref.yaml
+== complex-preserve-3d.yaml blank.yaml
+platform(linux,mac) fuzzy(9,348) == perspective-border-radius.yaml perspective-border-radius.png
+fuzzy(1,38) == snapped-preserve-3d.yaml snapped-preserve-3d-ref.yaml
+platform(linux,mac) fuzzy(1,122) == border-scale.yaml border-scale.png
+platform(linux,mac) fuzzy(1,16) == border-scale-2.yaml border-scale-2.png
+platform(linux,mac) fuzzy(1,69) == border-scale-3.yaml border-scale-3.png
+platform(linux,mac) fuzzy(1,74) == border-scale-4.yaml border-scale-4.png
+# Just make sure we aren't crashing here
+!= large-raster-root.yaml blank.yaml
+== flatten-preserve-3d-root.yaml flatten-preserve-3d-root-ref.yaml
+== flatten-twice.yaml flatten-twice-ref.yaml
+== strange-w.yaml strange-w-ref.yaml
+== big-axis-aligned-scale.yaml big-axis-aligned-scale-ref.yaml
+# Compare ~8K raster root (>MAX_SURFACE_SIZE) with ~2K raster root. fuzzy due to lerping on edges.
+skip_on(android) fuzzy-range(<=3,*3077,<=10,*133,<=93,*490) == raster_root_A_8192.yaml raster_root_A_ref.yaml
+# Same as large-raster-root.yaml but resulting in a 10302×100 raster root (= >4096) vs 4000x100 in ref:
+skip_on(android) fuzzy(60,917) == raster_root_B_8192.yaml raster_root_B_ref.yaml
+# Make sure we don't panic
+!= raster-root-large-mask.yaml blank.yaml
+skip_on(android) == raster-root-scaling.yaml raster-root-scaling-ref.yaml
+skip_on(android) == raster-root-scaling-2.yaml raster-root-scaling-2-ref.yaml
+# Make sure we don't panic
+!= raster-root-huge-scale.yaml blank.yaml
+!= non-inversible-world-rect.yaml blank.yaml
diff --git a/gfx/wr/wrench/reftests/transforms/rotate-clip-ref.yaml b/gfx/wr/wrench/reftests/transforms/rotate-clip-ref.yaml
new file mode 100644
index 0000000000..133279fca8
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/rotate-clip-ref.yaml
@@ -0,0 +1,7 @@
+---
+root:
+ items:
+ -
+ bounds: [100, 146, 150, 107]
+ type: rect
+ color: 0 128 0 1.0000
diff --git a/gfx/wr/wrench/reftests/transforms/rotate-clip.yaml b/gfx/wr/wrench/reftests/transforms/rotate-clip.yaml
new file mode 100644
index 0000000000..209d53d103
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/rotate-clip.yaml
@@ -0,0 +1,18 @@
+---
+root:
+ items:
+ -
+ type: clip
+ bounds: [0, 0, 2000, 2000]
+ clip-rect: [0, 0, 2000, 2000]
+ items:
+ -
+ bounds: [100, 0, 150, 150]
+ type: "stacking-context"
+ transform: rotate-x(45)
+ transform-origin: [0, 500]
+ items:
+ -
+ bounds: [0, 0, 150, 150]
+ type: rect
+ color: 0 128 0 1.0000
diff --git a/gfx/wr/wrench/reftests/transforms/rotated-clip-large.png b/gfx/wr/wrench/reftests/transforms/rotated-clip-large.png
new file mode 100644
index 0000000000..5d5757237e
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/rotated-clip-large.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/rotated-clip-large.yaml b/gfx/wr/wrench/reftests/transforms/rotated-clip-large.yaml
new file mode 100644
index 0000000000..ec57e6c697
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/rotated-clip-large.yaml
@@ -0,0 +1,17 @@
+---
+root:
+ items:
+ -
+ bounds: 100 100 300 300
+ items:
+ - type: clip
+ bounds: [20, 20, 200, 200]
+ complex:
+ - rect: [20, 20, 200, 200]
+ radius: 32
+ items:
+ - type: rect
+ bounds: 20 20 200 200
+ color: blue
+ type: stacking-context
+ transform: rotate(-33)
diff --git a/gfx/wr/wrench/reftests/transforms/rotated-clip.png b/gfx/wr/wrench/reftests/transforms/rotated-clip.png
new file mode 100644
index 0000000000..33d2771d3a
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/rotated-clip.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/rotated-clip.yaml b/gfx/wr/wrench/reftests/transforms/rotated-clip.yaml
new file mode 100644
index 0000000000..a4305e6449
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/rotated-clip.yaml
@@ -0,0 +1,17 @@
+---
+root:
+ items:
+ -
+ bounds: 100 100 100 100
+ items:
+ - type: clip
+ bounds: [20, 20, 100, 100]
+ complex:
+ - rect: [20, 20, 100, 100]
+ radius: 32
+ items:
+ - type: rect
+ bounds: 20 20 100 100
+ color: blue
+ type: stacking-context
+ transform: rotate(-30)
diff --git a/gfx/wr/wrench/reftests/transforms/rotated-image.png b/gfx/wr/wrench/reftests/transforms/rotated-image.png
new file mode 100644
index 0000000000..0374b9ad66
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/rotated-image.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/rotated-image.yaml b/gfx/wr/wrench/reftests/transforms/rotated-image.yaml
new file mode 100644
index 0000000000..5ab5d3b757
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/rotated-image.yaml
@@ -0,0 +1,75 @@
+---
+root:
+ items:
+ -
+ bounds: [0, 0, 2880, 1482]
+ "clip-rect": [0, 0, 2880, 1482]
+ "backface-visible": true
+ type: rect
+ color: white
+ -
+ bounds: [0, 0, 2880, 1482]
+ "clip-rect": [0, 0, 2880, 1482]
+ "backface-visible": true
+ type: clip
+ id: 10
+ "content-size": [2880, 1482]
+ -
+ "clip-rect": [0, 0, 2880, 1482]
+ "clip-and-scroll": 10
+ "backface-visible": true
+ type: "scroll-frame"
+ id: 2
+ "content-size": [2880, 1482]
+ bounds: [0, 0, 2880, 1482]
+ -
+ bounds: [0, 0, 2880, 1482]
+ "clip-rect": [0, 0, 2880, 1482]
+ "clip-and-scroll": 2
+ "backface-visible": true
+ type: clip
+ id: 3
+ "content-size": [2880, 1482]
+ -
+ bounds: [0, 0, 2880, 1482]
+ "clip-rect": [0, 0, 2880, 1482]
+ "clip-and-scroll": 3
+ "backface-visible": true
+ type: rect
+ color: white
+ -
+ bounds: [0, 0, 0, 0]
+ "clip-rect": [0, 0, 0, 0]
+ "clip-and-scroll": 3
+ "backface-visible": true
+ type: "stacking-context"
+ "scroll-policy": scrollable
+ transform: rotate-z(-1)
+ "transform-style": flat
+ items:
+ -
+ bounds: [2, 2, 200, 200]
+ "clip-rect": [2, 2, 200, 200]
+ "backface-visible": true
+ type: clip
+ id: 4
+ "content-size": [200, 200]
+ -
+ bounds: [2, -182, 152, 216]
+ "clip-rect": [2, 0, 152, 34]
+ "clip-and-scroll": 4
+ "backface-visible": true
+ image: "image.png"
+ "stretch-size": [152, 216]
+ "tile-spacing": [0, 0]
+ -
+ bounds: [0, 0, 204, 204]
+ "clip-rect": [0, 0, 204, 204]
+ "backface-visible": true
+ type: border
+ width: 2
+ "border-type": normal
+ color: 0 0 255 1.0000
+ style: solid
+ id: [1, 1]
+pipelines: []
diff --git a/gfx/wr/wrench/reftests/transforms/screen-space-blit-trivial.png b/gfx/wr/wrench/reftests/transforms/screen-space-blit-trivial.png
new file mode 100644
index 0000000000..ee1a8cc736
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/screen-space-blit-trivial.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/screen-space-blit-trivial.yaml b/gfx/wr/wrench/reftests/transforms/screen-space-blit-trivial.yaml
new file mode 100644
index 0000000000..76b2578faa
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/screen-space-blit-trivial.yaml
@@ -0,0 +1,22 @@
+# This test is similar to "screen-space-blit" but without filters,
+# so the implementation doesn't attempt to bake the contents
+# into a separate render target.
+---
+root:
+ items:
+ - type: "stacking-context"
+ perspective: 100
+ perspective-origin: 100 100
+ items:
+ - type: "stacking-context"
+ transform-origin: 235 235
+ transform: rotate-x(-15)
+ items:
+ - image: checkerboard(2, 16, 16)
+ bounds: [100, 100, 260, 260]
+ - type: "stacking-context"
+ transform-origin: 635 235
+ transform: rotate-z(-45)
+ items:
+ - image: checkerboard(2, 16, 16)
+ bounds: [500, 100, 260, 260]
diff --git a/gfx/wr/wrench/reftests/transforms/screen-space-blit.png b/gfx/wr/wrench/reftests/transforms/screen-space-blit.png
new file mode 100644
index 0000000000..9506d174c6
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/screen-space-blit.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/screen-space-blit.yaml b/gfx/wr/wrench/reftests/transforms/screen-space-blit.yaml
new file mode 100644
index 0000000000..0bae3a3736
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/screen-space-blit.yaml
@@ -0,0 +1,22 @@
+# This test uses `identity` filter on a preserve3D context to test how
+# filters mix up with the SC's baking for preserve3d.
+---
+root:
+ items:
+ - type: "stacking-context"
+ perspective: 100
+ perspective-origin: 100 100
+ items:
+ - type: "stacking-context"
+ transform-origin: 235 235
+ transform: rotate-x(-15)
+ filters: identity
+ items:
+ - image: checkerboard(2, 16, 16)
+ bounds: [100, 100, 260, 260]
+ - type: "stacking-context"
+ transform-origin: 635 235
+ transform: rotate-z(-45)
+ items:
+ - image: checkerboard(2, 16, 16)
+ bounds: [500, 100, 260, 260]
diff --git a/gfx/wr/wrench/reftests/transforms/screen-space-blur.png b/gfx/wr/wrench/reftests/transforms/screen-space-blur.png
new file mode 100644
index 0000000000..cfa1a7eb4d
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/screen-space-blur.png
Binary files differ
diff --git a/gfx/wr/wrench/reftests/transforms/screen-space-blur.yaml b/gfx/wr/wrench/reftests/transforms/screen-space-blur.yaml
new file mode 100644
index 0000000000..6d93260c83
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/screen-space-blur.yaml
@@ -0,0 +1,20 @@
+root:
+ items:
+ - type: "stacking-context"
+ perspective: 100
+ perspective-origin: 100 100
+ items:
+ - type: "stacking-context"
+ transform-origin: 235 235
+ transform: rotate-x(-15)
+ filters: blur(3, 3)
+ items:
+ - image: checkerboard(2, 16, 16)
+ bounds: [100, 100, 260, 260]
+ - type: "stacking-context"
+ transform-origin: 635 235
+ transform: rotate-z(-45)
+ filters: blur(3, 3)
+ items:
+ - image: checkerboard(2, 16, 16)
+ bounds: [500, 100, 260, 260]
diff --git a/gfx/wr/wrench/reftests/transforms/segments-bug-ref.yaml b/gfx/wr/wrench/reftests/transforms/segments-bug-ref.yaml
new file mode 100644
index 0000000000..aad75347ed
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/segments-bug-ref.yaml
@@ -0,0 +1,24 @@
+---
+root:
+ items:
+ -
+ type: "stacking-context"
+ items:
+ -
+ bounds: [12, 12, 130, 130]
+ type: clip
+ id: 4
+ complex:
+ -
+ rect: [12, 12, 130, 130]
+ radius: 20
+ "clip-mode": clip
+ -
+ clip-and-scroll: 4
+ type: "stacking-context"
+ items:
+ -
+ bounds: [12, 12, 130, 130]
+ clip-and-scroll: 4
+ type: rect
+ color: 0 128 0 1.0000
diff --git a/gfx/wr/wrench/reftests/transforms/segments-bug.yaml b/gfx/wr/wrench/reftests/transforms/segments-bug.yaml
new file mode 100644
index 0000000000..72130413fc
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/segments-bug.yaml
@@ -0,0 +1,27 @@
+# Test that opaque/alpha segments are correctly calculated
+# when the clip is in a different (but compatible) coordinate
+# space from the primitive.
+---
+root:
+ items:
+ -
+ type: "stacking-context"
+ items:
+ -
+ bounds: [12, 12, 130, 130]
+ type: clip
+ id: 4
+ complex:
+ -
+ rect: [12, 12, 130, 130]
+ radius: 20
+ "clip-mode": clip
+ -
+ "clip-and-scroll": 4
+ type: "stacking-context"
+ transform: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 12, 12, 0, 1]
+ items:
+ -
+ bounds: [0, 0, 130, 130]
+ type: rect
+ color: 0 128 0 1.0000
diff --git a/gfx/wr/wrench/reftests/transforms/singular-ref.yaml b/gfx/wr/wrench/reftests/transforms/singular-ref.yaml
new file mode 100644
index 0000000000..8401017c0d
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/singular-ref.yaml
@@ -0,0 +1,28 @@
+---
+root:
+ items:
+ -
+ bounds: [0, 0, 200, 200]
+ "clip-rect": [0, 0, 200, 200]
+ type: clip
+ id: 2
+ "content-size": [200, 200]
+ -
+ bounds: [0, 100, 100, 100]
+ "clip-rect": [0, 100, 100, 100]
+ "clip-and-scroll": 2
+ type: rect
+ color: blue
+ -
+ bounds: [100, 0, 100, 100]
+ "clip-rect": [100, 0, 100, 100]
+ "clip-and-scroll": 2
+ type: rect
+ color: green
+ -
+ bounds: [100, 100, 100, 100]
+ "clip-rect": [100, 100, 100, 100]
+ "clip-and-scroll": 2
+ type: rect
+ color: red
+
diff --git a/gfx/wr/wrench/reftests/transforms/singular.yaml b/gfx/wr/wrench/reftests/transforms/singular.yaml
new file mode 100644
index 0000000000..78d133b3ab
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/singular.yaml
@@ -0,0 +1,39 @@
+---
+root:
+ items:
+ -
+ bounds: [0, 0, 200, 200]
+ "clip-rect": [0, 0, 200, 200]
+ type: clip
+ id: 2
+ "content-size": [200, 200]
+ -
+ bounds: [10, 10, 80, 80]
+ clip-and-scroll: 2
+ type: "stacking-context"
+ transform: [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
+ items:
+ -
+ bounds: [0, 0, 80, 80]
+ "clip-rect": [0, 0, 80, 80]
+ type: rect
+ color: black
+ -
+ bounds: [0, 100, 100, 100]
+ "clip-rect": [0, 100, 100, 100]
+ clip-and-scroll: 2
+ type: rect
+ color: blue
+ -
+ bounds: [100, 0, 100, 100]
+ "clip-rect": [100, 0, 100, 100]
+ clip-and-scroll: 2
+ type: rect
+ color: green
+ -
+ bounds: [100, 100, 100, 100]
+ "clip-rect": [100, 100, 100, 100]
+ clip-and-scroll: 2
+ type: rect
+ color: red
+
diff --git a/gfx/wr/wrench/reftests/transforms/snapped-preserve-3d-ref.yaml b/gfx/wr/wrench/reftests/transforms/snapped-preserve-3d-ref.yaml
new file mode 100644
index 0000000000..a2e8972981
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/snapped-preserve-3d-ref.yaml
@@ -0,0 +1,19 @@
+---
+root:
+ items:
+ -
+ type: "stacking-context"
+ transform: translate(10, 10.5, 0)
+ items:
+ -
+ type: "stacking-context"
+ transform: translate(10, 10, 0)
+ items:
+ -
+ bounds: [10, 10.5, 200, 1]
+ type: rect
+ color: red
+ -
+ bounds: [10, 0, 200, 1]
+ type: rect
+ color: red
diff --git a/gfx/wr/wrench/reftests/transforms/snapped-preserve-3d.yaml b/gfx/wr/wrench/reftests/transforms/snapped-preserve-3d.yaml
new file mode 100644
index 0000000000..cd2cd8b1a7
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/snapped-preserve-3d.yaml
@@ -0,0 +1,21 @@
+---
+root:
+ items:
+ -
+ type: "stacking-context"
+ transform: translate(10, 10.5, 0)
+ "transform-style": "preserve-3d"
+ items:
+ -
+ type: "stacking-context"
+ transform: translate(10, 10, 0)
+ "transform-style": "preserve-3d"
+ items:
+ -
+ bounds: [10, 10.5, 200, 1]
+ type: rect
+ color: red
+ -
+ bounds: [10, 0, 200, 1]
+ type: rect
+ color: red
diff --git a/gfx/wr/wrench/reftests/transforms/strange-w-ref.yaml b/gfx/wr/wrench/reftests/transforms/strange-w-ref.yaml
new file mode 100644
index 0000000000..be50589d2a
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/strange-w-ref.yaml
@@ -0,0 +1,12 @@
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [50, 50, 600, 600]
+ perspective: 20
+ items:
+ - type: stacking-context
+ items:
+ - type: rect
+ bounds: [25, 25, 50, 50]
+ color: red
diff --git a/gfx/wr/wrench/reftests/transforms/strange-w.yaml b/gfx/wr/wrench/reftests/transforms/strange-w.yaml
new file mode 100644
index 0000000000..8e2a71b197
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/strange-w.yaml
@@ -0,0 +1,15 @@
+# don't assume w=1 when checking if the transform is just a translation
+
+---
+root:
+ items:
+ - type: stacking-context
+ bounds: [50, 50, 600, 600]
+ perspective: 20
+ items:
+ - type: stacking-context
+ transform: [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,2]
+ items:
+ - type: rect
+ bounds: [50, 50, 100, 100]
+ color: red