diff options
Diffstat (limited to 'gfx/wr/wrench/reftests/filters')
163 files changed, 3356 insertions, 0 deletions
diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-across-tiles.png b/gfx/wr/wrench/reftests/filters/backdrop-filter-across-tiles.png Binary files differnew file mode 100644 index 0000000000..39371a08c7 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-across-tiles.png diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-across-tiles.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-across-tiles.yaml new file mode 100644 index 0000000000..9b8145a545 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-across-tiles.yaml @@ -0,0 +1,12 @@ +# Verify that resolves across tile boundaries do correct readbacks +--- +root: + items: + - type: stacking-context + backdrop-root: true + items: + - image: xy-gradient(640,640) + bounds: 0 0 640 640 + - type: backdrop-filter + bounds: 20 20 600 600 + filters: [invert(1)] diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-basic-ref.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-basic-ref.yaml new file mode 100644 index 0000000000..aec471df21 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-basic-ref.yaml @@ -0,0 +1,11 @@ + +# Tests that a basic invert backdrop-filter works +--- +root: + items: + - type: stacking-context + bounds: 0 0 0 0 + items: + - type: rect + color: [0, 255, 255, 1] + bounds: 0 0 256 256 diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-basic.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-basic.yaml new file mode 100644 index 0000000000..95521d2fab --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-basic.yaml @@ -0,0 +1,21 @@ +# Tests that a basic invert backdrop-filter works +--- +root: + items: + - type: stacking-context + backdrop-root: true + bounds: 0 0 0 0 + items: + - type: rect + color: [255, 0, 0, 1] + bounds: 0 0 256 256 + - type: clip + id: 2 + bounds: 0 0 256 256 + clip-rect: 0 0 256 256 + - type: stacking-context + bounds: 0 0 0 0 + items: + - type: backdrop-filter + bounds: 0 0 256 256 + filters: invert(1) diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-across-tiles.png b/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-across-tiles.png Binary files differnew file mode 100644 index 0000000000..9164c78598 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-across-tiles.png diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-across-tiles.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-across-tiles.yaml new file mode 100644 index 0000000000..80be3ab493 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-across-tiles.yaml @@ -0,0 +1,19 @@ +# Verify that blurs across tile boundaries do correct readbacks +--- +root: + items: + - type: stacking-context + backdrop-root: true + bounds: 20 20 0 0 + items: + - image: checkerboard(2,32,32,16,22) + bounds: 0 0 516 644 + - type: backdrop-filter + bounds: 50 50 416 544 + filters: ["blur(5,5)"] + - type: border + bounds: [ 50, 50, 416, 544 ] + width: [ 1, 1, 1, 1 ] + border-type: normal + style: solid + color: black diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-edge-mode-ref.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-edge-mode-ref.yaml new file mode 100644 index 0000000000..99238dcc85 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-edge-mode-ref.yaml @@ -0,0 +1,10 @@ +# Verify that blurs on backdrop-filters use edgeMode=duplicate +--- +root: + items: + - type: rect + bounds: 0 0 400 400 + color: red + - type: rect + bounds: 100 100 200 200 + color: blue diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-edge-mode.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-edge-mode.yaml new file mode 100644 index 0000000000..53681976c6 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-blur-edge-mode.yaml @@ -0,0 +1,17 @@ +# Verify that blurs on backdrop-filters use edgeMode=duplicate +--- +root: + items: + - type: stacking-context + backdrop-root: true + bounds: 0 0 0 0 + items: + - type: rect + bounds: 0 0 400 400 + color: red + - type: rect + bounds: 100 100 200 200 + color: blue + - type: backdrop-filter + bounds: 100 100 200 200 + filters: ["blur(10,10)"] diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-chain.png b/gfx/wr/wrench/reftests/filters/backdrop-filter-chain.png Binary files differnew file mode 100644 index 0000000000..1d5c146711 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-chain.png diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-chain.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-chain.yaml new file mode 100644 index 0000000000..16f081ae73 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-chain.yaml @@ -0,0 +1,12 @@ +# Verify that backdrop filters with complex filter chains draw correctly +--- +root: + items: + - type: stacking-context + backdrop-root: true + items: + - image: "firefox.png" + bounds: 0 0 256 256 + - type: backdrop-filter + bounds: 50 50 100 100 + filters: ["blur(5,5)", sepia(0.5), brightness(0.8)] diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-clip-mask-ref.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-clip-mask-ref.yaml new file mode 100644 index 0000000000..e9683fc373 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-clip-mask-ref.yaml @@ -0,0 +1,9 @@ +--- +root: + items: + - type: rect + bounds: 0 0 256 256 + color: red + - type: rect + bounds: 64 64 128 128 + color: cyan
\ No newline at end of file diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-clip-mask.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-clip-mask.yaml new file mode 100644 index 0000000000..ee3bba5ab3 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-clip-mask.yaml @@ -0,0 +1,28 @@ +# Ensure that a backdrop-filter enclosed by a stacking context with +# a clip-mask can select the correct backdrop root +--- +root: + items: + - type: clip + id: 2 + image-mask: + image: solid-color(255,255,255,255,128,128) + rect: [64, 64, 128, 128] + repeat: false + - + type: "clip-chain" + id: 3 + clips: [2] + - type: stacking-context + backdrop-root: true + items: + - type: rect + bounds: 0 0 256 256 + color: red + - type: stacking-context + clip-chain: 3 + wraps-backdrop-filter: true + items: + - type: backdrop-filter + bounds: 0 0 256 256 + filters: invert(1)
\ No newline at end of file diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-culled-filter-ref.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-culled-filter-ref.yaml new file mode 100644 index 0000000000..bbcf0f820d --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-culled-filter-ref.yaml @@ -0,0 +1,5 @@ +--- +root: + items: + - image: checkerboard(2,14,14,14,14) + bounds: 0 0 200 200 diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-culled-filter.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-culled-filter.yaml new file mode 100644 index 0000000000..90edbcba16 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-culled-filter.yaml @@ -0,0 +1,25 @@ +# Ensure that the backdrop capture primitive is culled in the +# same way the backdrop render primitive is. +--- +root: + items: + - type: clip + bounds: [0, 0, 0, 0] + clip-rect: [0, 0, 0, 0] + id: 2 + - + type: "clip-chain" + id: 3 + clips: [2] + - image: checkerboard(2,14,14,14,14) + bounds: 0 0 200 200 + - type: stacking-context + transform: rotate(45) + transform-origin: 100 100 + filters: identity + wraps-backdrop-filter: true + clip-chain: 3 + items: + - type: backdrop-filter + bounds: 50 50 100 100 + filters: invert(1) diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-drop-shadow.png b/gfx/wr/wrench/reftests/filters/backdrop-filter-drop-shadow.png Binary files differnew file mode 100644 index 0000000000..dd72042a69 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-drop-shadow.png diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-drop-shadow.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-drop-shadow.yaml new file mode 100644 index 0000000000..e94b94f14a --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-drop-shadow.yaml @@ -0,0 +1,13 @@ +# Tests that a drop-shadow backdrop-filter works (involves very complex dependency graph due to picture + shadow content) +--- +root: + items: + - type: stacking-context + backdrop-root: true + items: + - type: rect + color: red + bounds: 0 0 128 128 + - type: backdrop-filter + bounds: 0 0 256 256 + filters: drop-shadow([20, 20], 10, [255, 0, 0, 1]) diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-half-opacity-ref.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-half-opacity-ref.yaml new file mode 100644 index 0000000000..e26ee0de4a --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-half-opacity-ref.yaml @@ -0,0 +1,5 @@ +root: + items: + - type: rect + bounds: [20, 20, 100, 100] + color: [128, 128, 128, 1] diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-half-opacity.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-half-opacity.yaml new file mode 100644 index 0000000000..33fac807a9 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-half-opacity.yaml @@ -0,0 +1,13 @@ +root: + items: + - type: rect + bounds: [20, 20, 100, 100] + color: [0, 128, 0, 1] + - type: stacking-context + bounds: [20, 20, 0, 0] + filters: [opacity(0.5)] + wraps-backdrop-filter: true + items: + - type: backdrop-filter + bounds: [0, 0, 100, 100] + filters: [invert(1)] diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-isolation-ref.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-isolation-ref.yaml new file mode 100644 index 0000000000..7bdc84f019 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-isolation-ref.yaml @@ -0,0 +1,20 @@ +# Ensure that stacking context isolation correctly works with backdrop-filter +# (doesn't apply the filter outside the bounds of the isolated stacking context bounds) +root: + items: + - type: rect + bounds: [10, 10, 100, 100] + color: [0, 128, 0, 1] + - type: stacking-context + bounds: [130, 10, 0, 0] + filters: [identity] + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 128, 0, 1] + - type: rect + bounds: [-90, 30, 160, 160] + color: [255, 255, 0, 0.5] + - type: rect + bounds: [0, 30, 70, 70] + color: [255, 191, 127, 1] diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-isolation.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-isolation.yaml new file mode 100644 index 0000000000..1ab896a234 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-isolation.yaml @@ -0,0 +1,20 @@ +# Ensure that stacking context isolation correctly works with backdrop-filter +# (doesn't apply the filter outside the bounds of the isolated stacking context bounds) +root: + items: + - type: rect + bounds: [10, 10, 100, 100] + color: [0, 128, 0, 1] + - type: stacking-context + bounds: [130, 10, 0, 0] + filters: [identity] + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 128, 0, 1] + - type: backdrop-filter + bounds: [-90, 30, 160, 160] + filters: [invert(1)] + - type: rect + bounds: [-90, 30, 160, 160] + color: [255, 255, 0, 0.5] diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-nested.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-nested.yaml new file mode 100644 index 0000000000..1f9e5286c9 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-nested.yaml @@ -0,0 +1,31 @@ +# Verify that when there are sibling backdrop-filters on the same backdrop +# root, but they are separated by a filter / clip chain, the dependencies +# are correctly set to ensure that the constrints for Existing render task +# locations are met (that the existing task is scheduled prior to the +# existing task, even if it's not needed for rendering order). +--- +root: + items: + - type: clip + id: 2 + image-mask: + image: solid-color(255,255,255,255,100,100) + rect: [0, 0, 100, 100] + repeat: false + - type: clip-chain + id: 12 + clips: [2] + - type: stacking-context + filters: [identity] + wraps-backdrop-filter: true + items: + - type: backdrop-filter + bounds: 0 0 100 100 + filters: identity + - type: stacking-context + wraps-backdrop-filter: true + clip-chain: 12 + items: + - type: backdrop-filter + bounds: 0 0 100 100 + filters: identity diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-on-child-surface-ref.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-on-child-surface-ref.yaml new file mode 100644 index 0000000000..214bb87ad0 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-on-child-surface-ref.yaml @@ -0,0 +1,7 @@ +# Tests that a basic invert backdrop-filter works on a child surface +--- +root: + items: + - type: rect + bounds: 0 0 256 256 + color: cyan diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-on-child-surface.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-on-child-surface.yaml new file mode 100644 index 0000000000..3792556ade --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-on-child-surface.yaml @@ -0,0 +1,14 @@ +# Tests that a basic invert backdrop-filter works on a child surface +--- +root: + items: + - type: stacking-context + backdrop-root: true + filters: [identity] + items: + - type: rect + bounds: 0 0 256 256 + color: red + - type: backdrop-filter + bounds: 0 0 256 256 + filters: invert(1) diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-overlap.png b/gfx/wr/wrench/reftests/filters/backdrop-filter-overlap.png Binary files differnew file mode 100644 index 0000000000..cebb57f862 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-overlap.png diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-overlap.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-overlap.yaml new file mode 100644 index 0000000000..68c5c0aba1 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-overlap.yaml @@ -0,0 +1,15 @@ +# Verify that sibling backdrop filters correctly read back intermediate results +--- +root: + items: + - type: stacking-context + backdrop-root: true + items: + - image: checkerboard(0,16,16) + bounds: 0 0 256 256 + - type: backdrop-filter + bounds: 32 32 192 192 + filters: [invert(1)] + - type: backdrop-filter + bounds: 64 64 128 128 + filters: [invert(1)] diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-perspective.png b/gfx/wr/wrench/reftests/filters/backdrop-filter-perspective.png Binary files differnew file mode 100644 index 0000000000..d9d49726bb --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-perspective.png diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-perspective.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-perspective.yaml new file mode 100644 index 0000000000..f5b9a1da64 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-perspective.yaml @@ -0,0 +1,32 @@ +# Tests that backdrop filter works with a perspective transform +--- +root: + items: + - type: stacking-context + bounds: 0 0 0 0 + backdrop-root: true + perspective: 500 + items: + - type: rect + color: [255, 255, 255, 1] + bounds: 0 0 1024 1024 + - image: "firefox.png" + bounds: 0 0 256 256 + - type: stacking-context + bounds: 50 50 0 0 + transform: ["rotate-y(-50)", "rotate-z(-45)"] + items: + - type: clip + id: 2 + bounds: 0 0 100 100 + clip-rect: 0 0 100 100 + - type: clip-chain + id: 12 + clips: [2] + - type: stacking-context + bounds: 0 0 0 0 + items: + - type: backdrop-filter + bounds: 0 0 100 100 + clip-chain: 12 + filters: invert(1) diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-transformed-filter.png b/gfx/wr/wrench/reftests/filters/backdrop-filter-transformed-filter.png Binary files differnew file mode 100644 index 0000000000..743bd03425 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-transformed-filter.png diff --git a/gfx/wr/wrench/reftests/filters/backdrop-filter-transformed-filter.yaml b/gfx/wr/wrench/reftests/filters/backdrop-filter-transformed-filter.yaml new file mode 100644 index 0000000000..dcde064917 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/backdrop-filter-transformed-filter.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: rect + color: red + bounds: 0 0 200 200 + - image: checkerboard(2,14,14,14,14) + bounds: 0 0 200 200 + - type: stacking-context + transform: rotate(45) + transform-origin: 100 100 + filters: identity + wraps-backdrop-filter: true + items: + - type: backdrop-filter + bounds: 50 50 100 100 + filters: invert(1) diff --git a/gfx/wr/wrench/reftests/filters/blank.yaml b/gfx/wr/wrench/reftests/filters/blank.yaml new file mode 100644 index 0000000000..c4eb3ab673 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/blank.yaml @@ -0,0 +1,2 @@ +--- +root: diff --git a/gfx/wr/wrench/reftests/filters/blend-clipped-raster-root.png b/gfx/wr/wrench/reftests/filters/blend-clipped-raster-root.png Binary files differnew file mode 100644 index 0000000000..ce3f7e229f --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/blend-clipped-raster-root.png diff --git a/gfx/wr/wrench/reftests/filters/blend-clipped-raster-root.yaml b/gfx/wr/wrench/reftests/filters/blend-clipped-raster-root.yaml new file mode 100644 index 0000000000..96e55f6a32 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/blend-clipped-raster-root.yaml @@ -0,0 +1,26 @@ +--- +root: + items: + - + bounds: [0, 100, 1000, 1000] + type: clip + id: 3 + - + type: "clip-chain" + id: 4 + clips: [3] + - + bounds: [200, 200, 0, 0] + clip-chain: 4 + type: "stacking-context" + transform: rotate(10) + items: + - + type: "stacking-context" + filters: + - opacity(0.5) + items: + - + bounds: [0, 0, 1000, 500] + type: rect + color: green diff --git a/gfx/wr/wrench/reftests/filters/blend-clipped.png b/gfx/wr/wrench/reftests/filters/blend-clipped.png Binary files differnew file mode 100644 index 0000000000..e500a538e8 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/blend-clipped.png diff --git a/gfx/wr/wrench/reftests/filters/blend-clipped.yaml b/gfx/wr/wrench/reftests/filters/blend-clipped.yaml new file mode 100644 index 0000000000..8162a96c09 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/blend-clipped.yaml @@ -0,0 +1,103 @@ +--- +root: + items: + - + type: "stacking-context" + items: + - + bounds: [0, 0, 1887, 2081] + "clip-rect": [0, 0, 1887, 2081] + "backface-visible": true + type: clip + id: 2 + "content-size": [1887, 2081] + - + bounds: [0, 111, 1887, 1970] + "clip-rect": [0, 111, 1887, 1970] + "backface-visible": true + type: clip + id: 3 + "content-size": [1887, 1970] + - + bounds: [0, 111, 1887, 1971] + "clip-rect": [0, 111, 1887, 1971] + "backface-visible": true + type: iframe + id: [1, 3] + id: [1, 1] +pipelines: + - + id: [1, 3] + items: + - + type: "stacking-context" + items: + - + bounds: [0, 0, 1887, 1971] + "clip-rect": [0, 0, 1887, 1971] + type: clip + id: 10 + "content-size": [1887, 1971] + - + "clip-rect": [0, 0, 1887, 1971] + type: "scroll-frame" + id: 2 + "content-size": [1887, 1971] + bounds: [0, 0, 1887, 1971] + - + bounds: [0, 0, 1887, 1971] + "clip-rect": [0, 0, 1887, 1971] + type: clip + id: 3 + "content-size": [1887, 1971] + - + type: "stacking-context" + items: + - + bounds: [0, -186, 1887, 239] + "clip-rect": [0, -186, 1887, 239] + "backface-visible": true + type: clip + id: 4 + "content-size": [1887, 239] + - + bounds: [-660.45, -186, 0, 0] + "clip-rect": [-660.45, -186, 0, 0] + spatial-id: 2 + type: "stacking-context" + transform: [1, 0, 0, 0, -0.57735026, 1, 0, 0, 0, 0, 1, 0, 68.849, 0, 0, 1] + items: + - + type: "stacking-context" + filters: + - opacity(0.8) + items: + - + bounds: [0, 0, 1887, 239] + "clip-rect": [0, 0, 1887, 239] + type: clip + id: 5 + "content-size": [1887, 239] + - type: clip-chain + id: 15 + clips: [3, 4, 5] + - + bounds: [0, 0, 1887, 239] + "clip-rect": [0, 0, 1887, 239] + clip-chain: 15 + "backface-visible": true + type: gradient + start: [943.5, -0.00000000000005684342] + end: [943.5, 238.5] + "tile-size": [1887, 238.5] + "tile-spacing": [0, 0] + stops: + - 0 + - 0 153 204.00002 1.0000 + - 0.3 + - 0 153 204.00002 1.0000 + - 0.6 + - 7.0000005 137 194.00002 1.0000 + - 1 + - 0 91 137 1.0000 + repeat: false diff --git a/gfx/wr/wrench/reftests/filters/drop-shadow-inverse-scale.yaml b/gfx/wr/wrench/reftests/filters/drop-shadow-inverse-scale.yaml new file mode 100644 index 0000000000..229bdaa4b6 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/drop-shadow-inverse-scale.yaml @@ -0,0 +1,14 @@ +# Ensure that zero sized drop shadows handle reflection scale transforms without crashing +--- +root: + items: + - + type: "stacking-context" + bounds: [100, 100, 100, 100] + filters: drop-shadow([0, 1], 1, red) + transform: scale(-1, 1) + items: + - + type: rect + color: green + bounds: [0, 0, 1, 0] diff --git a/gfx/wr/wrench/reftests/filters/filter-blur-clamping-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-blur-clamping-ref.yaml new file mode 100644 index 0000000000..a06489467a --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-blur-clamping-ref.yaml @@ -0,0 +1,18 @@ +# Ensures that blur clamping happens after scale factors are applied +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 300, 300] + filters: blur(100, 100) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: 0 255 0 1.0 + - type: stacking-context + bounds: [400, 100, 300, 300] + filters: blur(50, 50) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: 255 0 0 1.0 diff --git a/gfx/wr/wrench/reftests/filters/filter-blur-clamping.yaml b/gfx/wr/wrench/reftests/filters/filter-blur-clamping.yaml new file mode 100644 index 0000000000..0d81a616ee --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-blur-clamping.yaml @@ -0,0 +1,30 @@ +# Ensures that blur clamping happens after scale factors are applied +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 300, 300] + transform: scale(10) + items: + - type: stacking-context + bounds: [0, 0, 300, 300] + # Blur will be 20 * 10(scale) = 200 and it should then be clamped to 100 + filters: blur(20, 20) + items: + - type: rect + bounds: [0, 0, 10, 10] + color: 0 255 0 1.0 + - type: stacking-context + bounds: [400, 100, 300, 300] + transform: scale(0.1) + items: + - type: stacking-context + bounds: [0, 0, 300, 300] + # Blur should be 500 * 0.1(scale) = 50. This tests to make sure clamping + # does not occur before applying scale factors, otherwise 500 would be + # clamped to 100. + filters: blur(500, 500) + items: + - type: rect + bounds: [0, 0, 1000, 1000] + color: 255 0 0 1.0 diff --git a/gfx/wr/wrench/reftests/filters/filter-blur-downscale-fractional.png b/gfx/wr/wrench/reftests/filters/filter-blur-downscale-fractional.png Binary files differnew file mode 100644 index 0000000000..36da2d2620 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-blur-downscale-fractional.png diff --git a/gfx/wr/wrench/reftests/filters/filter-blur-downscale-fractional.yaml b/gfx/wr/wrench/reftests/filters/filter-blur-downscale-fractional.yaml new file mode 100644 index 0000000000..56f843d5ec --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-blur-downscale-fractional.yaml @@ -0,0 +1,11 @@ +# verify that we correctly size an image to a power of two when +# using downscale passes to avoid blur artifacts +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 300, 300] + filters: blur(16.4, 16.4) + items: + - image: "firefox.png" + bounds: 20 20 200 200 diff --git a/gfx/wr/wrench/reftests/filters/filter-blur-huge.yaml b/gfx/wr/wrench/reftests/filters/filter-blur-huge.yaml new file mode 100644 index 0000000000..13a4c72fd8 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-blur-huge.yaml @@ -0,0 +1,10 @@ +# Don't crash on very large blur radius! +--- +root: + items: + - type: stacking-context + bounds: [10, 10, 260, 260] + filters: blur(1000000, 1000000) + items: + - image: checkerboard(2, 16, 16) + bounds: [10, 10, 260, 260] diff --git a/gfx/wr/wrench/reftests/filters/filter-blur-scaled-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-blur-scaled-ref.yaml new file mode 100644 index 0000000000..6a5f314df0 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-blur-scaled-ref.yaml @@ -0,0 +1,11 @@ +# Ensure scales from enclosing SCs get applied to blurs +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 500, 500] + filters: blur(10, 10) + items: + - type: rect + bounds: [50, 50, 250, 250] + color: 0 255 0 1.0 diff --git a/gfx/wr/wrench/reftests/filters/filter-blur-scaled-xonly.png b/gfx/wr/wrench/reftests/filters/filter-blur-scaled-xonly.png Binary files differnew file mode 100644 index 0000000000..48f8913752 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-blur-scaled-xonly.png diff --git a/gfx/wr/wrench/reftests/filters/filter-blur-scaled-xonly.yaml b/gfx/wr/wrench/reftests/filters/filter-blur-scaled-xonly.yaml new file mode 100644 index 0000000000..18a897131d --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-blur-scaled-xonly.yaml @@ -0,0 +1,16 @@ +# Ensure scales from enclosing SCs get applied to blurs. This one +# applies a mixed-dimension scale by scaling the x-axis only. +--- +root: + items: + - type: reference-frame + bounds: [0, 0, 100, 100] + transform: [5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] + items: + - type: stacking-context + bounds: [0, 0, 100, 100] + filters: blur(2, 2) + items: + - type: rect + bounds: [10, 10, 50, 50] + color: 0 255 0 1.0 diff --git a/gfx/wr/wrench/reftests/filters/filter-blur-scaled.yaml b/gfx/wr/wrench/reftests/filters/filter-blur-scaled.yaml new file mode 100644 index 0000000000..0e8c9cbff9 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-blur-scaled.yaml @@ -0,0 +1,15 @@ +# Ensure scales from enclosing SCs get applied to blurs +--- +root: + items: + - type: reference-frame + bounds: [0, 0, 100, 100] + transform: [5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] + items: + - type: stacking-context + bounds: [0, 0, 100, 100] + filters: blur(2, 2) + items: + - type: rect + bounds: [10, 10, 50, 50] + color: 0 255 0 1.0 diff --git a/gfx/wr/wrench/reftests/filters/filter-blur.png b/gfx/wr/wrench/reftests/filters/filter-blur.png Binary files differnew file mode 100644 index 0000000000..695db74925 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-blur.png diff --git a/gfx/wr/wrench/reftests/filters/filter-blur.yaml b/gfx/wr/wrench/reftests/filters/filter-blur.yaml new file mode 100644 index 0000000000..ee915d7bb1 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-blur.yaml @@ -0,0 +1,9 @@ +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 300, 300] + filters: blur(10, 10) + items: + - image: "firefox.png" + bounds: 20 20 256 256 diff --git a/gfx/wr/wrench/reftests/filters/filter-brightness-2-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-brightness-2-ref.yaml new file mode 100644 index 0000000000..209dfb3cc3 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-brightness-2-ref.yaml @@ -0,0 +1,9 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [10, 10, 100, 100] + color: [0, 0, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-brightness-2.yaml b/gfx/wr/wrench/reftests/filters/filter-brightness-2.yaml new file mode 100644 index 0000000000..2bdb20aa1a --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-brightness-2.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: brightness(0) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [255, 0, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-brightness-3-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-brightness-3-ref.yaml new file mode 100644 index 0000000000..3201170182 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-brightness-3-ref.yaml @@ -0,0 +1,9 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [10, 10, 100, 100] + color: [0, 128, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-brightness-3.yaml b/gfx/wr/wrench/reftests/filters/filter-brightness-3.yaml new file mode 100644 index 0000000000..8ea1eef5a8 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-brightness-3.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: brightness(4) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 32, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-brightness-4-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-brightness-4-ref.yaml new file mode 100644 index 0000000000..b300d2a026 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-brightness-4-ref.yaml @@ -0,0 +1,9 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [10, 10, 100, 100] + color: [0, 64, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-brightness-4.yaml b/gfx/wr/wrench/reftests/filters/filter-brightness-4.yaml new file mode 100644 index 0000000000..9a15b15895 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-brightness-4.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: brightness(0.25) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 255, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-brightness-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-brightness-ref.yaml new file mode 100644 index 0000000000..98e1bf419a --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-brightness-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [64, 64, 64, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-brightness.yaml b/gfx/wr/wrench/reftests/filters/filter-brightness.yaml new file mode 100644 index 0000000000..65da0e0b25 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-brightness.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: brightness(2) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [255, 255, 255, 0.25] diff --git a/gfx/wr/wrench/reftests/filters/filter-color-matrix-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-color-matrix-ref.yaml new file mode 100644 index 0000000000..2d32e5307b --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-color-matrix-ref.yaml @@ -0,0 +1,21 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 170] + items: + - type: rect + bounds: [0, 0, 120, 170] + color: [0, 0, 0, 1] + - type: rect + bounds: [10, 10, 50, 50] + color: [100, 175, 136, 1] + - type: rect + bounds: [10, 60, 50, 50] + color: [255, 0, 255, 1] + - type: rect + bounds: [60, 10, 50, 50] + color: [255, 0, 0, 1] + - type: rect + bounds: [10, 110, 50, 50] + color: [0, 0, 128, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-color-matrix.yaml b/gfx/wr/wrench/reftests/filters/filter-color-matrix.yaml new file mode 100644 index 0000000000..4deb19b779 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-color-matrix.yaml @@ -0,0 +1,53 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 170] + items: + - type: rect + bounds: [0, 0, 120, 170] + color: [0, 0, 0, 1] + - type: stacking-context + bounds: [10, 10, 50, 50] + filters: color-matrix( 0.393, 0.686, 0.534, 0, + 0.189, 0.168, 0.131, 0, + 0.349, 0.272, 0, 0, + 0, 0, 0, 1, + 0, 0, 0, 0 ) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 0, 1] + - type: stacking-context + bounds: [10, 60, 50, 50] + filters: color-matrix( -1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, -1, 0, + 0, 0, 0, 1, + 1, 1, 1, 0 ) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 255, 0, 1] + - type: stacking-context + bounds: [60, 10, 50, 50] + filters: color-matrix( 0, 0, 1, 0, + 0, 1, 0, 0, + 1, 0, 0, 0, + 0, 0, 0, 1, + 0, 0, 0, 0 ) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 0, 255, 1] + - type: stacking-context + bounds: [10, 110, 50, 50] + filters: color-matrix( 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0.5, + 0, 0, 0, 0, + 0, 0, 0, 0 ) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 0, 255, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-component-transfer-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-component-transfer-ref.yaml new file mode 100644 index 0000000000..e19e1ff0b0 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-component-transfer-ref.yaml @@ -0,0 +1,51 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 170, 250] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 255, 1] + - type: rect + bounds: [0, 50, 50, 50] + color: [0, 255, 141, 1] + - type: rect + bounds: [0, 100, 50, 50] + color: [255, 255, 0, 1] + - type: rect + bounds: [0, 150, 50, 50] + color: [191, 128, 128, 1] + - type: rect + bounds: [0, 200, 50, 50] + color: [0, 255, 24, 1] + - type: rect + bounds: [60, 0, 50, 50] + color: [255, 0, 255, 1] + - type: rect + bounds: [60, 50, 50, 50] + color: [255, 255, 255, 1] + - type: rect + bounds: [60, 100, 50, 50] + color: [255, 255, 255, 1] + - type: rect + bounds: [60, 150, 50, 50] + color: [223, 191, 191, 1] + - type: rect + bounds: [60, 200, 50, 50] + color: [191, 255, 197, 1] + - type: rect + bounds: [120, 0, 50, 50] + color: [255, 127, 255, 1] + - type: rect + bounds: [120, 50, 50, 50] + color: [128, 255, 200, 1] + - type: rect + bounds: [120, 100, 50, 50] + color: [255, 255, 255, 1] + - type: rect + bounds: [120, 150, 50, 50] + color: [239, 223, 223, 1] + - type: rect + bounds: [120, 200, 50, 50] + color: [63, 255, 81, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-component-transfer.yaml b/gfx/wr/wrench/reftests/filters/filter-component-transfer.yaml new file mode 100644 index 0000000000..a573b5587e --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-component-transfer.yaml @@ -0,0 +1,352 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 170, 250] + items: + - type: stacking-context + bounds: [0, 0, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Identity + - Identity + - Identity + - Identity + - [] + - [] + - [] + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 255, 1] + - type: stacking-context + bounds: [0, 50, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Table + - Table + - Table + - Identity + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [173, 255, 47, 1] + - type: stacking-context + bounds: [0, 100, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Discrete + - Discrete + - Discrete + - Identity + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 255, 255, 1] + - type: stacking-context + bounds: [0, 150, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Linear + - Linear + - Linear + - Identity + - - "0.5" + - "0.25" + - - "0.5" + - "0" + - - "0.5" + - "0.5" + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 255, 0, 1] + - type: stacking-context + bounds: [0, 200, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Gamma + - Gamma + - Gamma + - Identity + - - "2" + - "5" + - "-1" + - - "2" + - "3" + - "0" + - - "2" + - "1" + - "-1.75" + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [135, 206, 235, 1] + - type: stacking-context + bounds: [60, 0, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Identity + - Identity + - Identity + - Identity + - [] + - [] + - [] + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 255, 1] + - type: stacking-context + bounds: [60, 50, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Table + - Table + - Table + - Table + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - - "1" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [173, 255, 47, 1] + - type: stacking-context + bounds: [60, 100, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Discrete + - Discrete + - Discrete + - Discrete + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - - "1" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 255, 255, 1] + - type: stacking-context + bounds: [60, 150, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Linear + - Linear + - Linear + - Linear + - - "0.5" + - "0.25" + - - "0.5" + - "0" + - - "0.5" + - "0.5" + - - "0.5" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 255, 0, 1] + - type: stacking-context + bounds: [60, 200, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Gamma + - Gamma + - Gamma + - Gamma + - - "2" + - "5" + - "-1" + - - "2" + - "3" + - "0" + - - "2" + - "1" + - "-1.75" + - - "2" + - "1" + - "-1.75" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [135, 206, 235, 1] + - type: stacking-context + bounds: [120, 0, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Identity + - Identity + - Identity + - Identity + - [] + - [] + - [] + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 255, 0.5] + - type: stacking-context + bounds: [120, 50, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Table + - Table + - Table + - Table + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - - "1" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [173, 255, 47, 0.5] + - type: stacking-context + bounds: [120, 100, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Discrete + - Discrete + - Discrete + - Discrete + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - - "1" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 255, 255, 0.5] + - type: stacking-context + bounds: [120, 150, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Linear + - Linear + - Linear + - Linear + - - "0.5" + - "0.25" + - - "0.5" + - "0" + - - "0.5" + - "0.5" + - - "0.5" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 255, 0, 0.5] + - type: stacking-context + bounds: [120, 200, 50, 50] + filters: + - component-transfer + filter-datas: + - - - Gamma + - Gamma + - Gamma + - Gamma + - - "2" + - "5" + - "-1" + - - "2" + - "3" + - "0" + - - "2" + - "1" + - "-1.75" + - - "2" + - "1" + - "-0.25" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [135, 206, 235, 0.5] diff --git a/gfx/wr/wrench/reftests/filters/filter-contrast-gray-alpha-1-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-contrast-gray-alpha-1-ref.yaml new file mode 100644 index 0000000000..6b176d9570 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-contrast-gray-alpha-1-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [255, 255, 255, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [223, 223, 223, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-contrast-gray-alpha-1.yaml b/gfx/wr/wrench/reftests/filters/filter-contrast-gray-alpha-1.yaml new file mode 100644 index 0000000000..87758d3f4a --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-contrast-gray-alpha-1.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: contrast(0) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [128, 128, 128, 0.25] diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-blur-clamping-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-blur-clamping-ref.yaml new file mode 100644 index 0000000000..6ffcde5f5b --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-blur-clamping-ref.yaml @@ -0,0 +1,18 @@ +# Ensures that blur clamping happens after scale factors are applied +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 300, 300] + filters: drop-shadow([0, 0], 100, blue) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: 0 255 0 1.0 + - type: stacking-context + bounds: [400, 100, 300, 300] + filters: drop-shadow([0, 0], 50, green) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: 255 0 0 1.0 diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-blur-clamping.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-blur-clamping.yaml new file mode 100644 index 0000000000..1d7157a8e6 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-blur-clamping.yaml @@ -0,0 +1,30 @@ +# Ensures that blur clamping happens after scale factors are applied +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 300, 300] + transform: scale(10) + items: + - type: stacking-context + bounds: [0, 0, 300, 300] + # Blur will be 20 * 10(scale) = 200 and it should then be clamped to 100 + filters: drop-shadow([0, 0], 20, blue) + items: + - type: rect + bounds: [0, 0, 10, 10] + color: 0 255 0 1.0 + - type: stacking-context + bounds: [400, 100, 300, 300] + transform: scale(0.1) + items: + - type: stacking-context + bounds: [0, 0, 300, 300] + # Blur should be 500 * 0.1(scale) = 50. This tests to make sure clamping + # does not occur before applying scale factors, otherwise 500 would be + # clamped to 100. + filters: drop-shadow([0, 0], 500, green) + items: + - type: rect + bounds: [0, 0, 1000, 1000] + color: 255 0 0 1.0 diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.png b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.png Binary files differnew file mode 100644 index 0000000000..7b3d1d87ce --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.png diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.yaml new file mode 100644 index 0000000000..4616d5e290 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.yaml @@ -0,0 +1,21 @@ +# Bug 1561447: If a clip task is created for a picture, it should take into account the rect of the drop shadow +--- +root: + items: + - type: clip + id: 2 + bounds: 10 0 300 300 + clip-rect: 10 0 300 300 + - + type: "clip-chain" + id: 3 + clips: [2] + - type: stacking-context + bounds: 30 30 0 0 + transform: rotate-z(-45) + filters: drop-shadow([15, 0], 0, red) + clip-chain: 3 + items: + - type: rect + bounds: 0 0 100 100 + color: blue diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-3.png b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-3.png Binary files differnew file mode 100644 index 0000000000..40eded52ac --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-3.png diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-3.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-3.yaml new file mode 100644 index 0000000000..4b9ad3d36e --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-3.yaml @@ -0,0 +1,37 @@ +--- +# WebRender internally clips the stacking context to avoid +# rendering parts that are off-screen. It has to take shadow +# offsets into account. +# This test introduces a 90 degrees rotation to ensure that +# the clip inflation isn't done in the wrong space. +root: + items: + # Rotation inside of the shadowed stacking context. + - type: stacking-context + bounds: [0, -10, 200, 100] + filters: drop-shadow([-10, 200], 5, red) + items: + - type: stacking-context + bounds: [50, -10, 200, 100] + transform: rotate-z(-90) + items: + - + bounds: [0, 0, 500, 150] + glyphs: [55, 75, 76, 86] + offsets: [0, 100, 75, 100, 150, 100, 180, 100] + size: 90 + color: blue + font: "../text/VeraBd.ttf" + # Rotation applied to the shadowed stacking context directly. + - type: stacking-context + bounds: [150, 35, 200, 100] + filters: drop-shadow([200, 10], 5, red) + transform: rotate-z(-90) + items: + - + bounds: [0, 0, 500, 150] + glyphs: [55, 75, 76, 86] + offsets: [0, 100, 75, 100, 150, 100, 180, 100] + size: 90 + color: blue + font: "../text/VeraBd.ttf" diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip.png b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip.png Binary files differnew file mode 100644 index 0000000000..6b0624c8c1 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip.png diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip.yaml new file mode 100644 index 0000000000..33f066328d --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip.yaml @@ -0,0 +1,27 @@ +--- +root: + items: + - type: clip + id: 3 + complex: + - rect: [0, 0, 256, 256] + radius: 16 + - type: clip-chain + id: 5 + clips: [3] + - type: clip + id: 4 + bounds: [100, 100, 2000, 2000] + - + type: "clip-chain" + id: 6 + clips: [4] + - type: stacking-context + bounds: [10, 10, 0, 0] + filters: drop-shadow([50, 50], 25, red) + clip-chain: 6 + items: + - type: rect + bounds: 0 0 256 256 + color: green + clip-chain: 5 diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-fractional.png b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-fractional.png Binary files differnew file mode 100644 index 0000000000..f75e2c5c9e --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-fractional.png diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-fractional.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-fractional.yaml new file mode 100644 index 0000000000..e61ae8ec45 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-fractional.yaml @@ -0,0 +1,11 @@ +# Verify that drop shadows with fractional blur radii are correctly centered +--- +root: + items: + - type: stacking-context + bounds: [20, 20, 0, 0] + filters: drop-shadow([0, 0], 5.01, [255, 0, 0, 1]) + items: + - type: rect + bounds: 0 0 100 100 + color: black diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-huge.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-huge.yaml new file mode 100644 index 0000000000..dc971a7d3a --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-huge.yaml @@ -0,0 +1,10 @@ +# Don't crash on very large blur radius! +--- +root: + items: + - type: stacking-context + bounds: [10, 10, 260, 260] + filters: drop-shadow([73, 73], 10000000, [255, 0, 0, 1]) + items: + - image: checkerboard(2, 16, 16) + bounds: [10, 10, 260, 260] diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-on-viewport-edge.png b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-on-viewport-edge.png Binary files differnew file mode 100644 index 0000000000..a63372edfb --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-on-viewport-edge.png diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-on-viewport-edge.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-on-viewport-edge.yaml new file mode 100644 index 0000000000..663c03a0de --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-on-viewport-edge.yaml @@ -0,0 +1,10 @@ +--- +root: + items: + - type: stacking-context + bounds: [10, 10, 400, 400] + filters: drop-shadow([10, 10], 20, [255, 0, 0, 1]) + items: + - type: rect + bounds: 0 0 256 256 + color: green diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-scaled-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-scaled-ref.yaml new file mode 100644 index 0000000000..9173528be4 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-scaled-ref.yaml @@ -0,0 +1,11 @@ +# Ensure scales from enclosing SCs get applied to drop-shadows +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 500, 500] + filters: drop-shadow([0, 0], 10, [255, 0, 0, 1]) + items: + - type: rect + bounds: [50, 50, 250, 250] + color: 0 255 0 1.0 diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-scaled.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-scaled.yaml new file mode 100644 index 0000000000..87fac1ee6d --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-scaled.yaml @@ -0,0 +1,15 @@ +# Ensure scales from enclosing SCs get applied to drop-shadows +--- +root: + items: + - type: reference-frame + bounds: [0, 0, 100, 100] + transform: [5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] + items: + - type: stacking-context + bounds: [0, 0, 400, 400] + filters: drop-shadow([0, 0], 2, [255, 0, 0, 1]) + items: + - type: rect + bounds: [10, 10, 50, 50] + color: 0 255 0 1.0 diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-transform-huge.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-transform-huge.yaml new file mode 100644 index 0000000000..e46af9dfa4 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-transform-huge.yaml @@ -0,0 +1,17 @@ +# Don't crash on large blur radius with large transform! +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 1000, 1000] + items: + - type: stacking-context + bounds: [0, 0, 1000, 1000] + transform: scale-y(100) + items: + - type: stacking-context + bounds: [0, 0, 1000, 1000] + filters: drop-shadow([0, 0], 999999, [255, 0, 0, 1]) + items: + - image: checkerboard(2, 16, 16) + bounds: [0, 0, 1000, 1000] diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow.png b/gfx/wr/wrench/reftests/filters/filter-drop-shadow.png Binary files differnew file mode 100644 index 0000000000..cf9355e63c --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow.png diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow.yaml new file mode 100644 index 0000000000..59f90b42da --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow.yaml @@ -0,0 +1,9 @@ +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 400, 400] + filters: drop-shadow([73, 73], 20, [255, 0, 0, 1]) + items: + - image: "firefox.png" + bounds: 0 0 256 256 diff --git a/gfx/wr/wrench/reftests/filters/filter-grayscale-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-grayscale-ref.yaml new file mode 100644 index 0000000000..6a0baae7d9 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-grayscale-ref.yaml @@ -0,0 +1,6 @@ +--- +root: + items: + - type: rect + bounds: [10, 10, 200, 200] + color: [182, 182, 182] diff --git a/gfx/wr/wrench/reftests/filters/filter-grayscale.yaml b/gfx/wr/wrench/reftests/filters/filter-grayscale.yaml new file mode 100644 index 0000000000..efa299cc07 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-grayscale.yaml @@ -0,0 +1,10 @@ +--- +root: + items: + - type: stacking-context + bounds: [10, 10, 200, 200] + filters: grayscale(1) + items: + - type: rect + bounds: [0, 0, 200, 200] + color: [0, 255, 0] diff --git a/gfx/wr/wrench/reftests/filters/filter-hue-rotate-1-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-hue-rotate-1-ref.yaml new file mode 100644 index 0000000000..a1c4039010 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-hue-rotate-1-ref.yaml @@ -0,0 +1,21 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + - type: rect + bounds: [10, 10, 50, 50] + color: [0, 91, 0, 1] + - type: rect + bounds: [10, 60, 50, 50] + color: [0, 218, 255, 1] + - type: rect + bounds: [60, 10, 50, 50] + color: [255, 0, 37, 1] + - type: rect + bounds: [60, 60, 50, 50] + color: [128, 128, 128, 1]
\ No newline at end of file diff --git a/gfx/wr/wrench/reftests/filters/filter-hue-rotate-1.yaml b/gfx/wr/wrench/reftests/filters/filter-hue-rotate-1.yaml new file mode 100644 index 0000000000..9934661bbd --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-hue-rotate-1.yaml @@ -0,0 +1,37 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + - type: stacking-context + bounds: [10, 10, 50, 50] + filters: hue-rotate(90) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 0, 1] + - type: stacking-context + bounds: [10, 60, 50, 50] + filters: hue-rotate(90) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 255, 0, 1] + - type: stacking-context + bounds: [60, 10, 50, 50] + filters: hue-rotate(90) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 0, 255, 1] + - type: stacking-context + bounds: [60, 60, 50, 50] + filters: hue-rotate(90) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [128, 128, 128, 1]
\ No newline at end of file diff --git a/gfx/wr/wrench/reftests/filters/filter-hue-rotate-alpha-1-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-hue-rotate-alpha-1-ref.yaml new file mode 100644 index 0000000000..436f30937a --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-hue-rotate-alpha-1-ref.yaml @@ -0,0 +1,21 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + - type: rect + bounds: [10, 10, 50, 50] + color: [0, 46, 0, 1] + - type: rect + bounds: [10, 60, 50, 50] + color: [0, 109, 128, 1] + - type: rect + bounds: [60, 10, 50, 50] + color: [128, 0, 18, 1] + - type: rect + bounds: [60, 60, 50, 50] + color: [64, 64, 64, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-hue-rotate-alpha-1.yaml b/gfx/wr/wrench/reftests/filters/filter-hue-rotate-alpha-1.yaml new file mode 100644 index 0000000000..b38cb218ff --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-hue-rotate-alpha-1.yaml @@ -0,0 +1,37 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + - type: stacking-context + bounds: [10, 10, 50, 50] + filters: hue-rotate(90) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 0, 0.5] + - type: stacking-context + bounds: [10, 60, 50, 50] + filters: hue-rotate(90) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 255, 0, 0.5] + - type: stacking-context + bounds: [60, 10, 50, 50] + filters: hue-rotate(90) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 0, 255, 0.5] + - type: stacking-context + bounds: [60, 60, 50, 50] + filters: hue-rotate(90) + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [128, 128, 128, 0.5]
\ No newline at end of file diff --git a/gfx/wr/wrench/reftests/filters/filter-invert-2-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-invert-2-ref.yaml new file mode 100644 index 0000000000..08aa94333d --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-invert-2-ref.yaml @@ -0,0 +1,9 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 255, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-invert-2.yaml b/gfx/wr/wrench/reftests/filters/filter-invert-2.yaml new file mode 100644 index 0000000000..f254816dc5 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-invert-2.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 255, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: invert(1) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [255, 255, 0, 0.5] diff --git a/gfx/wr/wrench/reftests/filters/filter-invert-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-invert-ref.yaml new file mode 100644 index 0000000000..674ecee969 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-invert-ref.yaml @@ -0,0 +1,9 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [10, 10, 100, 100] + color: [0, 0, 0, 0.25] diff --git a/gfx/wr/wrench/reftests/filters/filter-invert.yaml b/gfx/wr/wrench/reftests/filters/filter-invert.yaml new file mode 100644 index 0000000000..57ebcdb43c --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-invert.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: invert(1) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [255, 255, 255, 0.25] diff --git a/gfx/wr/wrench/reftests/filters/filter-large-blur-radius.png b/gfx/wr/wrench/reftests/filters/filter-large-blur-radius.png Binary files differnew file mode 100644 index 0000000000..e48a567c38 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-large-blur-radius.png diff --git a/gfx/wr/wrench/reftests/filters/filter-large-blur-radius.yaml b/gfx/wr/wrench/reftests/filters/filter-large-blur-radius.yaml new file mode 100644 index 0000000000..6ce5f4cb22 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-large-blur-radius.yaml @@ -0,0 +1,10 @@ +--- +root: + items: + - type: stacking-context + bounds: 100 100 512 512 + filters: blur(100, 100) + items: + - type: rect + bounds: 0 0 512 512 + color: red diff --git a/gfx/wr/wrench/reftests/filters/filter-long-chain.png b/gfx/wr/wrench/reftests/filters/filter-long-chain.png Binary files differnew file mode 100644 index 0000000000..6e58dd6300 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-long-chain.png diff --git a/gfx/wr/wrench/reftests/filters/filter-long-chain.yaml b/gfx/wr/wrench/reftests/filters/filter-long-chain.yaml new file mode 100644 index 0000000000..a0f9d698bd --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-long-chain.yaml @@ -0,0 +1,19 @@ +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 400, 400] + filters: [brightness(2), + contrast(0.4), + grayscale(0.2), + hue-rotate(270), + invert(0.6), + opacity(0.8), + saturate(10), + sepia(0.4), + "blur(3,3)", + "drop-shadow([73, 73], 3, [0, 255, 0, 1])"] + items: + - type: rect + color: red + bounds: 0 0 256 256 diff --git a/gfx/wr/wrench/reftests/filters/filter-mix-blend-mode-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-mix-blend-mode-ref.yaml new file mode 100644 index 0000000000..0a43095403 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-mix-blend-mode-ref.yaml @@ -0,0 +1,6 @@ +--- +root: + items: + - type: rect + color: [128, 128, 127, 1] + bounds: 100 100 100 100 diff --git a/gfx/wr/wrench/reftests/filters/filter-mix-blend-mode.yaml b/gfx/wr/wrench/reftests/filters/filter-mix-blend-mode.yaml new file mode 100644 index 0000000000..0b6e3eb468 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-mix-blend-mode.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + blend-container: true + items: + - type: rect + color: [128, 128, 128, 1] + bounds: 100 100 100 100 + - type: stacking-context + bounds: [100, 100, 100, 100] + filters: [invert(1)] + mix-blend-mode: exclusion + items: + - type: rect + color: yellow + bounds: 0 0 100 100 diff --git a/gfx/wr/wrench/reftests/filters/filter-mix-blend-scaling-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-mix-blend-scaling-ref.yaml new file mode 100644 index 0000000000..949da2b16b --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-mix-blend-scaling-ref.yaml @@ -0,0 +1,11 @@ + +# Tests that mix-blend mode content renders correctly when in a scaled surface. +# See bug 1642549 +--- +root: + items: + - type: stacking-context + bounds: 0 0 0 0 + items: + - rect: 0 0 150 150 + color: green diff --git a/gfx/wr/wrench/reftests/filters/filter-mix-blend-scaling.yaml b/gfx/wr/wrench/reftests/filters/filter-mix-blend-scaling.yaml new file mode 100644 index 0000000000..577f4edebf --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-mix-blend-scaling.yaml @@ -0,0 +1,23 @@ +# Tests that mix-blend mode content renders correctly when in a scaled surface. +# See bug 1642549 +--- +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: -50 -50 0 0 + # The raster root will have a 2x scaling factor + transform: scale(2) + blend-container: true + items: + - rect: 0 0 100 100 + color: green + - type: stacking-context + mix-blend-mode: multiply + items: + - rect: 0 0 100 100 + color: white diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-blue-1-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-1-ref.yaml new file mode 100644 index 0000000000..9b5a96e542 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-1-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [18, 18, 18, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-blue-1.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-1.yaml new file mode 100644 index 0000000000..22d47f10e0 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-1.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(0) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 0, 255, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-blue-2-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-2-ref.yaml new file mode 100644 index 0000000000..a83166358d --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-2-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [9, 9, 137, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-blue-2.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-2.yaml new file mode 100644 index 0000000000..0b8cac5609 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-2.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(0.5) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 0, 255, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-blue-3-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-3-ref.yaml new file mode 100644 index 0000000000..ebb3450e02 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-3-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [0, 0, 255, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-blue-3.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-3.yaml new file mode 100644 index 0000000000..060d0294ff --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-3.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(1) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 0, 255, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-blue-alpha-1-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-alpha-1-ref.yaml new file mode 100644 index 0000000000..321bea6876 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-alpha-1-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [5, 5, 69, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-blue-alpha-1.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-alpha-1.yaml new file mode 100644 index 0000000000..1a264cc458 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-blue-alpha-1.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(0.5) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 0, 255, 0.5] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-green-1-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-green-1-ref.yaml new file mode 100644 index 0000000000..2a710fae15 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-green-1-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [182, 182, 182, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-green-1.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-green-1.yaml new file mode 100644 index 0000000000..4fcfa8174b --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-green-1.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(0) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 255, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-green-2-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-green-2-ref.yaml new file mode 100644 index 0000000000..f13c6e225d --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-green-2-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [91, 219, 91, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-green-2.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-green-2.yaml new file mode 100644 index 0000000000..98f033bb76 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-green-2.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(0.5) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 255, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-green-3-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-green-3-ref.yaml new file mode 100644 index 0000000000..00aae63bdc --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-green-3-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [0, 255, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-green-3.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-green-3.yaml new file mode 100644 index 0000000000..c7f3561171 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-green-3.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(1) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 255, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-green-alpha-1-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-green-alpha-1-ref.yaml new file mode 100644 index 0000000000..e4c5643f29 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-green-alpha-1-ref.yaml @@ -0,0 +1,12 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + - type: rect + bounds: [10, 10, 100, 100] + color: [46, 110, 46, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-green-alpha-1.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-green-alpha-1.yaml new file mode 100644 index 0000000000..042d19d6f5 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-green-alpha-1.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(0.5) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 255, 0, 0.5] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-red-1-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-red-1-ref.yaml new file mode 100644 index 0000000000..3b95adb53a --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-red-1-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [54, 54, 54, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-red-1.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-red-1.yaml new file mode 100644 index 0000000000..9dab61a552 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-red-1.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(0) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [255, 0, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-red-2-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-red-2-ref.yaml new file mode 100644 index 0000000000..f6707424d0 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-red-2-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [155, 27, 27, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-red-2.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-red-2.yaml new file mode 100644 index 0000000000..5810894a2c --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-red-2.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(0.5) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [255, 0, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-red-3-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-red-3-ref.yaml new file mode 100644 index 0000000000..0c9e4f4ac2 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-red-3-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: rect + bounds: [10, 10, 100, 100] + color: [255, 0, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-red-3.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-red-3.yaml new file mode 100644 index 0000000000..ce9ed012d3 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-red-3.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(1) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [255, 0, 0, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-red-alpha-1-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-red-alpha-1-ref.yaml new file mode 100644 index 0000000000..bdcd52d339 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-red-alpha-1-ref.yaml @@ -0,0 +1,12 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + - type: rect + bounds: [10, 10, 100, 100] + color: [78, 14, 14, 1] diff --git a/gfx/wr/wrench/reftests/filters/filter-saturate-red-alpha-1.yaml b/gfx/wr/wrench/reftests/filters/filter-saturate-red-alpha-1.yaml new file mode 100644 index 0000000000..11218fcf85 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-saturate-red-alpha-1.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 120] + items: + - type: rect + bounds: [0, 0, 120, 120] + color: [0, 0, 0, 1] + + - type: stacking-context + bounds: [10, 10, 100, 100] + filters: saturate(0.5) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [255, 0, 0, 0.5] diff --git a/gfx/wr/wrench/reftests/filters/filter-segments-ref.yaml b/gfx/wr/wrench/reftests/filters/filter-segments-ref.yaml new file mode 100644 index 0000000000..1047323d23 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-segments-ref.yaml @@ -0,0 +1,18 @@ +--- +root: + items: + - type: clip + id: 2 + complex: + - rect: [10, 10, 256, 256] + radius: 16 + - type: rect + color: [54, 54, 54] + bounds: [10, 10, 512, 512] + clip-chain: [2] + - type: rect + color: red + bounds: [0, 0, 300, 32] + - type: rect + color: red + bounds: [0, 250, 300, 32] diff --git a/gfx/wr/wrench/reftests/filters/filter-segments.yaml b/gfx/wr/wrench/reftests/filters/filter-segments.yaml new file mode 100644 index 0000000000..dbb62ed7d3 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-segments.yaml @@ -0,0 +1,24 @@ +# Ensure that picture / filter primitives draw the entire primitive +# when they are eligible to be segmented. The red rects are used to +# mask out the corners, since the AA varies between the tests. +--- +root: + items: + - type: clip + id: 2 + complex: + - rect: [10, 10, 256, 256] + radius: 16 + - type: stacking-context + filters: grayscale(1) + items: + - type: rect + color: red + bounds: [10, 10, 512, 512] + clip-chain: [2] + - type: rect + color: red + bounds: [0, 0, 300, 32] + - type: rect + color: red + bounds: [0, 250, 300, 32] diff --git a/gfx/wr/wrench/reftests/filters/filter-small-blur-radius.png b/gfx/wr/wrench/reftests/filters/filter-small-blur-radius.png Binary files differnew file mode 100644 index 0000000000..e755e2bb6c --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-small-blur-radius.png diff --git a/gfx/wr/wrench/reftests/filters/filter-small-blur-radius.yaml b/gfx/wr/wrench/reftests/filters/filter-small-blur-radius.yaml new file mode 100644 index 0000000000..d5b550d0ab --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-small-blur-radius.yaml @@ -0,0 +1,10 @@ +--- +root: + items: + - type: stacking-context + bounds: 100 100 512 512 + filters: blur(2, 2) + items: + - type: rect + bounds: 0 0 512 512 + color: red diff --git a/gfx/wr/wrench/reftests/filters/firefox.png b/gfx/wr/wrench/reftests/filters/firefox.png Binary files differnew file mode 100644 index 0000000000..696ba9c9b5 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/firefox.png diff --git a/gfx/wr/wrench/reftests/filters/iframe-dropshadow-ref.yaml b/gfx/wr/wrench/reftests/filters/iframe-dropshadow-ref.yaml new file mode 100644 index 0000000000..47c7140163 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/iframe-dropshadow-ref.yaml @@ -0,0 +1,22 @@ +# a drop-shadow in an iframe causes the content to not render +--- +root: + items: + - + type: "stacking-context" + bounds: [0, 148, 1920, 1606] + items: + - + type: "rect" + color: [255, 0, 0, 1] + bounds: [387, 12, 34, 38] + clip-rect: [386, 11, 36, 40] + - + type: "stacking-context" + filters: drop-shadow([0, 4], 2, [0, 0, 0, 0.3294117748737335]) + items: + - + type: "rect" + color: [255, 0, 0, 1] + bounds: [345, 12, 34, 38] + clip-rect: [344, 11, 36, 40] diff --git a/gfx/wr/wrench/reftests/filters/iframe-dropshadow.yaml b/gfx/wr/wrench/reftests/filters/iframe-dropshadow.yaml new file mode 100644 index 0000000000..440e757e04 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/iframe-dropshadow.yaml @@ -0,0 +1,34 @@ +# a drop-shadow in an iframe causes the content to not render +--- +root: + items: + - + type: "stacking-context" + items: + - + type: iframe + id: [1, 2] + bounds: [0, 148, 1920, 1606] + clip-rect: [0, 148, 1920, 1606] + +pipelines: + - + id: [1, 2] + items: + - + type: "stacking-context" + items: + - + type: "rect" + color: [255, 0, 0, 1] + bounds: [387, 12, 34, 38] + clip-rect: [386, 11, 36, 40] + - + type: "stacking-context" + filters: drop-shadow([0, 4], 2, [0, 0, 0, 0.3294117748737335]) + items: + - + type: "rect" + color: [255, 0, 0, 1] + bounds: [345, 12, 34, 38] + clip-rect: [344, 11, 36, 40] diff --git a/gfx/wr/wrench/reftests/filters/invisible-ref.yaml b/gfx/wr/wrench/reftests/filters/invisible-ref.yaml new file mode 100644 index 0000000000..ec31525d31 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/invisible-ref.yaml @@ -0,0 +1,6 @@ +--- +root: + items: + - type: rect + bounds: [10, 10, 50, 50] + color: green diff --git a/gfx/wr/wrench/reftests/filters/invisible.yaml b/gfx/wr/wrench/reftests/filters/invisible.yaml new file mode 100644 index 0000000000..c4a99e64a8 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/invisible.yaml @@ -0,0 +1,27 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 100, 100] + filters: opacity(0.0), + items: + - type: stacking-context + bounds: [0, 0, 100, 100] + items: + - type: stacking-context + bounds: [0, 0, 100, 100] + items: + - type: stacking-context + bounds: [0, 0, 100, 100] + items: + - type: stacking-context + bounds: [0, 0, 100, 100] + items: + - type: rect + bounds: [70, 70, 50, 50] + color: green + # This display item ensures that the stacking context is skipped, but + # later items are not. + - type: rect + bounds: [10, 10, 50, 50] + color: green diff --git a/gfx/wr/wrench/reftests/filters/isolated-ref.yaml b/gfx/wr/wrench/reftests/filters/isolated-ref.yaml new file mode 100644 index 0000000000..28c6912a97 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/isolated-ref.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 0, 0] + - type: stacking-context + bounds: [0, 0, 100, 100] + filters: opacity(0.5) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 255, 0] diff --git a/gfx/wr/wrench/reftests/filters/isolated.yaml b/gfx/wr/wrench/reftests/filters/isolated.yaml new file mode 100644 index 0000000000..5f61ba2dfa --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/isolated.yaml @@ -0,0 +1,17 @@ +# this tests that filters don't create isolated groups +--- +root: + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 0, 0] + - type: stacking-context + bounds: [0, 0, 100, 100] + items: + - type: stacking-context + bounds: [0, 0, 100, 100] + filters: opacity(0.5) + items: + - type: rect + bounds: [0, 0, 100, 100] + color: [0, 255, 0] diff --git a/gfx/wr/wrench/reftests/filters/opacity-combined-ref.yaml b/gfx/wr/wrench/reftests/filters/opacity-combined-ref.yaml new file mode 100644 index 0000000000..2b008f0a2f --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/opacity-combined-ref.yaml @@ -0,0 +1,10 @@ +# this tests that opacity combination respets pre-multiplied alpha +root: + items: + - type: stacking-context + bounds: [10, 10, 500, 500] + filters: [opacity(0.25)] + items: + - type: rect + bounds: [10, 10, 100, 100] + color: green diff --git a/gfx/wr/wrench/reftests/filters/opacity-combined.yaml b/gfx/wr/wrench/reftests/filters/opacity-combined.yaml new file mode 100644 index 0000000000..7d9bfa4ac5 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/opacity-combined.yaml @@ -0,0 +1,10 @@ +# this tests that opacity combination respects pre-multiplied alpha +root: + items: + - type: stacking-context + bounds: [10, 10, 500, 500] + filters: [opacity(0.50), opacity(0.50)] + items: + - type: rect + bounds: [10, 10, 100, 100] + color: green diff --git a/gfx/wr/wrench/reftests/filters/opacity-overlap-ref.yaml b/gfx/wr/wrench/reftests/filters/opacity-overlap-ref.yaml new file mode 100644 index 0000000000..d3ad75812e --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/opacity-overlap-ref.yaml @@ -0,0 +1,9 @@ +# this tests opacity rectangle overlapping with opaque one +root: + items: + - type: stacking-context + bounds: [10, 10, 500, 500] + items: + - type: rect + bounds: [10, 10, 100, 100] + color: [32, 0, 96] diff --git a/gfx/wr/wrench/reftests/filters/opacity-overlap.yaml b/gfx/wr/wrench/reftests/filters/opacity-overlap.yaml new file mode 100644 index 0000000000..94832004a3 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/opacity-overlap.yaml @@ -0,0 +1,16 @@ +# this tests opacity rectangle overlapping with opaque one +root: + items: + - type: stacking-context + bounds: [10, 10, 500, 500] + items: + - type: rect + bounds: [10, 10, 100, 100] + color: [128, 0, 0] + - type: stacking-context + bounds: [10, 10, 500, 500] + filters: [opacity(0.75)] + items: + - type: rect + bounds: [10, 10, 100, 100] + color: [0, 0, 128] diff --git a/gfx/wr/wrench/reftests/filters/opacity-ref.yaml b/gfx/wr/wrench/reftests/filters/opacity-ref.yaml new file mode 100644 index 0000000000..ffe06bc5fd --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/opacity-ref.yaml @@ -0,0 +1,8 @@ +root: + items: + - type: stacking-context + bounds: [10, 10, 500, 500] + items: + - type: rect + bounds: [10, 10, 100, 100] + color: [255, 255, 209, 1.0] diff --git a/gfx/wr/wrench/reftests/filters/opacity.yaml b/gfx/wr/wrench/reftests/filters/opacity.yaml new file mode 100644 index 0000000000..838937de2a --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/opacity.yaml @@ -0,0 +1,10 @@ +# this tests opacity pre-multiplied color +root: + items: + - type: stacking-context + bounds: [10, 10, 500, 500] + filters: [opacity(0.9)] + items: + - type: rect + bounds: [10, 10, 100, 100] + color: [255, 255, 0, 0.2] diff --git a/gfx/wr/wrench/reftests/filters/reftest.list b/gfx/wr/wrench/reftests/filters/reftest.list new file mode 100644 index 0000000000..493cb6ff8c --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/reftest.list @@ -0,0 +1,85 @@ +== filter-grayscale.yaml filter-grayscale-ref.yaml +platform(linux,mac) == draw_calls(7) color_targets(7) alpha_targets(0) filter-blur.yaml filter-blur.png +platform(linux,mac) == filter-blur-downscale-fractional.yaml filter-blur-downscale-fractional.png +== isolated.yaml isolated-ref.yaml +== invisible.yaml invisible-ref.yaml +fuzzy-if(platform(swgl),1,10000) == opacity.yaml opacity-ref.yaml +fuzzy-range(<=1,*10000) == opacity-combined.yaml opacity-combined-ref.yaml +fuzzy-if(platform(swgl),1,10000) == opacity-overlap.yaml opacity-overlap-ref.yaml +== filter-brightness.yaml filter-brightness-ref.yaml +== filter-brightness-2.yaml filter-brightness-2-ref.yaml +== filter-brightness-3.yaml filter-brightness-3-ref.yaml +fuzzy-if(platform(swgl),1,10000) == filter-brightness-4.yaml filter-brightness-4-ref.yaml +== filter-component-transfer.yaml filter-component-transfer-ref.yaml +skip_on(android,device) == filter-color-matrix.yaml filter-color-matrix-ref.yaml # fails on Pixel2 +== filter-contrast-gray-alpha-1.yaml filter-contrast-gray-alpha-1-ref.yaml +== filter-invert.yaml filter-invert-ref.yaml +== filter-invert-2.yaml filter-invert-2-ref.yaml +platform(linux,mac) fuzzy(1,133) == filter-large-blur-radius.yaml filter-large-blur-radius.png +skip_on(android,device) fuzzy(1,12) fuzzy-if(platform(swgl),2,12276) == draw_calls(7) color_targets(6) alpha_targets(0) filter-small-blur-radius.yaml filter-small-blur-radius.png # fails on Pixel2 +== filter-saturate-red-1.yaml filter-saturate-red-1-ref.yaml +== filter-saturate-red-2.yaml filter-saturate-red-2-ref.yaml +== filter-saturate-red-3.yaml filter-saturate-red-3-ref.yaml +== filter-saturate-green-1.yaml filter-saturate-green-1-ref.yaml +== filter-saturate-green-2.yaml filter-saturate-green-2-ref.yaml +== filter-saturate-green-3.yaml filter-saturate-green-3-ref.yaml +== filter-saturate-blue-1.yaml filter-saturate-blue-1-ref.yaml +== filter-saturate-blue-2.yaml filter-saturate-blue-2-ref.yaml +== filter-saturate-blue-3.yaml filter-saturate-blue-3-ref.yaml +== filter-saturate-red-alpha-1.yaml filter-saturate-red-alpha-1-ref.yaml +== filter-saturate-green-alpha-1.yaml filter-saturate-green-alpha-1-ref.yaml +== filter-saturate-blue-alpha-1.yaml filter-saturate-blue-alpha-1-ref.yaml +fuzzy(1,14) == filter-hue-rotate-1.yaml filter-hue-rotate-1-ref.yaml +skip_on(android,device) == filter-hue-rotate-alpha-1.yaml filter-hue-rotate-alpha-1-ref.yaml # Fails on Pixel2 +skip_on(android,device) fuzzy(2,9072) fuzzy-if(platform(swgl),9,109897) == filter-long-chain.yaml filter-long-chain.png # fails on Pixel2 +platform(linux,mac) == filter-drop-shadow.yaml filter-drop-shadow.png +platform(linux,mac) == filter-drop-shadow-on-viewport-edge.yaml filter-drop-shadow-on-viewport-edge.png +platform(linux,mac) == blend-clipped.yaml blend-clipped.png +platform(linux,mac) == filter-drop-shadow-clip.yaml filter-drop-shadow-clip.png +fuzzy(2,10) platform(linux,mac) == filter-drop-shadow-clip-2.yaml filter-drop-shadow-clip-2.png +fuzzy(1,58) platform(linux) == filter-drop-shadow-clip-3.yaml filter-drop-shadow-clip-3.png +fuzzy(5,100000) == filter-drop-shadow-scaled.yaml filter-drop-shadow-scaled-ref.yaml +== filter-segments.yaml filter-segments-ref.yaml +== iframe-dropshadow.yaml iframe-dropshadow-ref.yaml +skip_on(android,device) == filter-mix-blend-mode.yaml filter-mix-blend-mode-ref.yaml # fails on Pixel2 +== fuzzy(3,20000) srgb-to-linear.yaml srgb-to-linear-ref.yaml +!= srgb-to-linear-2.yaml srgb-to-linear-ref.yaml +!= filter-blur-huge.yaml blank.yaml +!= filter-drop-shadow-huge.yaml blank.yaml +!= filter-drop-shadow-transform-huge.yaml blank.yaml +fuzzy(4,62000) == filter-drop-shadow-blur-clamping.yaml filter-drop-shadow-blur-clamping-ref.yaml +== filter-blur-scaled.yaml filter-blur-scaled-ref.yaml +fuzzy(5,72000) == filter-blur-clamping.yaml filter-blur-clamping-ref.yaml +skip_on(android,device) skip_on(win) fuzzy(1,104) fuzzy-if(platform(swgl),4,18484) == filter-blur-scaled-xonly.yaml filter-blur-scaled-xonly.png # fails on Pixel2 +== svg-filter-component-transfer.yaml filter-component-transfer-ref.yaml +== svg-filter-flood.yaml svg-filter-flood-ref.yaml +skip_on(android,device) == svg-filter-blend.yaml svg-filter-blend-ref.yaml +skip_on(android,device) == svg-filter-color-matrix.yaml filter-color-matrix-ref.yaml # fails on Pixel2 +platform(linux,mac) == draw_calls(8) color_targets(8) alpha_targets(0) svg-filter-blur.yaml filter-blur.png # Extra draw call is due to render task graph workaround +platform(linux,mac) == svg-filter-drop-shadow.yaml svg-filter-drop-shadow.png +== fuzzy(1,10000) svg-srgb-to-linear.yaml srgb-to-linear-ref.yaml +platform(linux,mac) == fuzzy(6,36790) svg-filter-drop-shadow-rotate.yaml svg-filter-drop-shadow-rotate-ref.yaml +platform(linux,mac) fuzzy(3,3550) == svg-filter-blur-transforms.yaml svg-filter-blur-transforms.png +platform(linux,mac) == svg-filter-drop-shadow-on-viewport-edge.yaml svg-filter-drop-shadow-on-viewport-edge.png +fuzzy(1,1) platform(linux,mac) == svg-filter-drop-shadow-perspective.yaml svg-filter-drop-shadow-perspective.png +== backdrop-filter-basic.yaml backdrop-filter-basic-ref.yaml +platform(linux,mac) == backdrop-filter-perspective.yaml backdrop-filter-perspective.png +== backdrop-filter-on-child-surface.yaml backdrop-filter-on-child-surface-ref.yaml +== backdrop-filter-clip-mask.yaml backdrop-filter-clip-mask-ref.yaml +platform(linux,mac) == backdrop-filter-across-tiles.yaml backdrop-filter-across-tiles.png +platform(linux,mac) == backdrop-filter-chain.yaml backdrop-filter-chain.png +platform(linux,mac) == backdrop-filter-overlap.yaml backdrop-filter-overlap.png +platform(linux,mac) == backdrop-filter-blur-across-tiles.yaml backdrop-filter-blur-across-tiles.png +== fuzzy(1,4900) backdrop-filter-isolation.yaml backdrop-filter-isolation-ref.yaml +#platform(linux,mac) == backdrop-filter-drop-shadow.yaml backdrop-filter-drop-shadow.png +== backdrop-filter-blur-edge-mode.yaml backdrop-filter-blur-edge-mode-ref.yaml +== backdrop-filter-half-opacity.yaml backdrop-filter-half-opacity-ref.yaml +== backdrop-filter-culled-filter.yaml backdrop-filter-culled-filter-ref.yaml +== backdrop-filter-nested.yaml blank.yaml # just don't crash +platform(linux,mac) == backdrop-filter-transformed-filter.yaml backdrop-filter-transformed-filter.png +platform(linux,max) == svg-filter-offset.yaml svg-filter-offset-ref.yaml +skip_on(android,device) == fuzzy(1,100) svg-filter-composite.yaml svg-filter-composite-ref.yaml +skip_on(android,device) == filter-mix-blend-scaling.yaml filter-mix-blend-scaling-ref.yaml +platform(linux) == blend-clipped-raster-root.yaml blend-clipped-raster-root.png +== drop-shadow-inverse-scale.yaml blank.yaml +platform(linux,mac) == filter-drop-shadow-fractional.yaml filter-drop-shadow-fractional.png diff --git a/gfx/wr/wrench/reftests/filters/srgb-to-linear-2.yaml b/gfx/wr/wrench/reftests/filters/srgb-to-linear-2.yaml new file mode 100644 index 0000000000..333ef502ae --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/srgb-to-linear-2.yaml @@ -0,0 +1,16 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 300, 100] + filters: [srgb-to-linear] + items: + - type: rect + bounds: [100, 0, 100, 100] + color: [200, 200, 200, 1.0] + - type: rect + bounds: [100, 0, 100, 100] + color: [100, 100, 100, 1.0] + - type: rect + bounds: [200, 0, 100, 100] + color: [50, 50, 50, 1.0] diff --git a/gfx/wr/wrench/reftests/filters/srgb-to-linear-ref.yaml b/gfx/wr/wrench/reftests/filters/srgb-to-linear-ref.yaml new file mode 100644 index 0000000000..d984523da6 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/srgb-to-linear-ref.yaml @@ -0,0 +1,15 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 300, 100] + items: + - type: rect + bounds: [100, 0, 100, 100] + color: [200, 200, 200, 1.0] + - type: rect + bounds: [100, 0, 100, 100] + color: [100, 100, 100, 1.0] + - type: rect + bounds: [200, 0, 100, 100] + color: [50, 50, 50, 1.0] diff --git a/gfx/wr/wrench/reftests/filters/srgb-to-linear.yaml b/gfx/wr/wrench/reftests/filters/srgb-to-linear.yaml new file mode 100644 index 0000000000..67eb35119f --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/srgb-to-linear.yaml @@ -0,0 +1,16 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 300, 100] + filters: [srgb-to-linear, linear-to-srgb] + items: + - type: rect + bounds: [100, 0, 100, 100] + color: [200, 200, 200, 1.0] + - type: rect + bounds: [100, 0, 100, 100] + color: [100, 100, 100, 1.0] + - type: rect + bounds: [200, 0, 100, 100] + color: [50, 50, 50, 1.0] diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-blend-ref.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-blend-ref.yaml new file mode 100644 index 0000000000..d796f0b85e --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-blend-ref.yaml @@ -0,0 +1,21 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 50, 250] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 255, 0, 1] + - type: rect + bounds: [0, 50, 50, 50] + color: [40, 20, 2, 1] + - type: rect + bounds: [0, 100, 50, 50] + color: [20, 10, 155, 1] + - type: rect + bounds: [0, 150, 50, 50] + color: [255, 222, 156, 1] + - type: rect + bounds: [0, 200, 50, 50] + color: [255, 245, 151, 1] diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-blend.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-blend.yaml new file mode 100644 index 0000000000..2167013d3c --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-blend.yaml @@ -0,0 +1,83 @@ +# Tests various blend modes using the blend filter primitive. +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 50, 250] + filter-primitives: + - type: flood + color: [255, 255, 255, 1] + color-space: srgb + - type: blend + in1: original + in2: 0 + color-space: srgb + blend-mode: difference + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 255, 1] + + - type: stacking-context + bounds: [0, 0, 50, 250] + filter-primitives: + - type: flood + color: [51, 51, 51, 1] + color-space: srgb + - type: blend + in1: original + in2: 0 + color-space: srgb + blend-mode: multiply + items: + - type: rect + bounds: [0, 50, 50, 50] + color: [200, 100, 10, 1] + + - type: stacking-context + bounds: [0, 0, 50, 250] + filter-primitives: + - type: flood + color: [255, 10, 156, 1] + color-space: srgb + - type: blend + in1: original + in2: 0 + color-space: srgb + blend-mode: darken + items: + - type: rect + bounds: [0, 100, 50, 50] + color: [20, 222, 155, 1] + + - type: stacking-context + bounds: [0, 0, 50, 250] + filter-primitives: + - type: flood + color: [255, 10, 156, 1] + color-space: srgb + - type: blend + in1: original + in2: 0 + color-space: srgb + blend-mode: lighten + items: + - type: rect + bounds: [0, 150, 50, 50] + color: [20, 222, 155, 1] + + - type: stacking-context + bounds: [0, 0, 50, 250] + filter-primitives: + - type: flood + color: [255, 10, 156, 1] + color-space: srgb + - type: blend + in1: original + in2: 0 + color-space: srgb + blend-mode: exclusion + items: + - type: rect + bounds: [0, 200, 50, 50] + color: [0, 255, 24, 1] diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-blur-transforms.png b/gfx/wr/wrench/reftests/filters/svg-filter-blur-transforms.png Binary files differnew file mode 100644 index 0000000000..890c815bef --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-blur-transforms.png diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-blur-transforms.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-blur-transforms.yaml new file mode 100644 index 0000000000..d78f3ae806 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-blur-transforms.yaml @@ -0,0 +1,16 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 100, 300, 300] + transform: scale-x(0.1) rotate-z(-45) + filter-primitives: + - type: blur + width: 10 + height: 10 + in: previous + color-space: srgb + items: + - type: rect + color: red + bounds: 0 0 256 256 diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-blur.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-blur.yaml new file mode 100644 index 0000000000..5554688500 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-blur.yaml @@ -0,0 +1,14 @@ +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 300, 300] + filter-primitives: + - type: blur + width: 10 + height: 10 + in: previous + color-space: srgb + items: + - image: "firefox.png" + bounds: 20 20 256 256 diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-color-matrix.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-color-matrix.yaml new file mode 100644 index 0000000000..60166b7514 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-color-matrix.yaml @@ -0,0 +1,69 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 120, 170] + items: + - type: rect + bounds: [0, 0, 120, 170] + color: [0, 0, 0, 1] + - type: stacking-context + bounds: [10, 10, 50, 50] + filter-primitives: + - type: color-matrix + in: previous + color-space: srgb + matrix: [0.393, 0.686, 0.534, 0, + 0.189, 0.168, 0.131, 0, + 0.349, 0.272, 0, 0, + 0, 0, 0, 1, + 0, 0, 0, 0] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 0, 1] + - type: stacking-context + bounds: [10, 60, 50, 50] + filter-primitives: + - type: color-matrix + in: previous + color-space: srgb + matrix: [-1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, -1, 0, + 0, 0, 0, 1, + 1, 1, 1, 0] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 255, 0, 1] + - type: stacking-context + bounds: [60, 10, 50, 50] + filter-primitives: + - type: color-matrix + in: previous + color-space: srgb + matrix: [0, 0, 1, 0, + 0, 1, 0, 0, + 1, 0, 0, 0, + 0, 0, 0, 1, + 0, 0, 0, 0] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 0, 255, 1] + - type: stacking-context + bounds: [10, 110, 50, 50] + filter-primitives: + - type: color-matrix + in: previous + color-space: srgb + matrix: [1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0.5, + 0, 0, 0, 0, + 0, 0, 0, 0] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 0, 255, 1] diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-component-transfer.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-component-transfer.yaml new file mode 100644 index 0000000000..88b56a4a25 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-component-transfer.yaml @@ -0,0 +1,382 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 50, 250] + items: + - type: stacking-context + bounds: [0, 0, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Identity + - Identity + - Identity + - Identity + - [] + - [] + - [] + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 255, 1] + - type: stacking-context + bounds: [0, 50, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Table + - Table + - Table + - Identity + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [173, 255, 47, 1] + - type: stacking-context + bounds: [0, 100, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Discrete + - Discrete + - Discrete + - Identity + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 255, 255, 1] + - type: stacking-context + bounds: [0, 150, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Linear + - Linear + - Linear + - Identity + - - "0.5" + - "0.25" + - - "0.5" + - "0" + - - "0.5" + - "0.5" + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 255, 0, 1] + - type: stacking-context + bounds: [0, 200, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Gamma + - Gamma + - Gamma + - Identity + - - "2" + - "5" + - "-1" + - - "2" + - "3" + - "0" + - - "2" + - "1" + - "-1.75" + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [135, 206, 235, 1] + - type: stacking-context + bounds: [60, 0, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Identity + - Identity + - Identity + - Identity + - [] + - [] + - [] + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 255, 1] + - type: stacking-context + bounds: [60, 50, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Table + - Table + - Table + - Table + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - - "1" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [173, 255, 47, 1] + - type: stacking-context + bounds: [60, 100, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Discrete + - Discrete + - Discrete + - Discrete + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - - "1" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 255, 255, 1] + - type: stacking-context + bounds: [60, 150, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Linear + - Linear + - Linear + - Linear + - - "0.5" + - "0.25" + - - "0.5" + - "0" + - - "0.5" + - "0.5" + - - "0.5" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 255, 0, 1] + - type: stacking-context + bounds: [60, 200, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Gamma + - Gamma + - Gamma + - Gamma + - - "2" + - "5" + - "-1" + - - "2" + - "3" + - "0" + - - "2" + - "1" + - "-1.75" + - - "2" + - "1" + - "-1.75" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [135, 206, 235, 1] + - type: stacking-context + bounds: [120, 0, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Identity + - Identity + - Identity + - Identity + - [] + - [] + - [] + - [] + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 0, 255, 0.5] + - type: stacking-context + bounds: [120, 50, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Table + - Table + - Table + - Table + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - - "1" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [173, 255, 47, 0.5] + - type: stacking-context + bounds: [120, 100, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Discrete + - Discrete + - Discrete + - Discrete + - - "1" + - "1" + - "0" + - "0" + - - "0" + - "0" + - "1" + - "1" + - - "0" + - "1" + - "1" + - "0" + - - "1" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [0, 255, 255, 0.5] + - type: stacking-context + bounds: [120, 150, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Linear + - Linear + - Linear + - Linear + - - "0.5" + - "0.25" + - - "0.5" + - "0" + - - "0.5" + - "0.5" + - - "0.5" + - "0" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [255, 255, 0, 0.5] + - type: stacking-context + bounds: [120, 200, 50, 50] + filter-primitives: + - type: component-transfer + color-space: srgb + in: previous + filter-datas: + - - - Gamma + - Gamma + - Gamma + - Gamma + - - "2" + - "5" + - "-1" + - - "2" + - "3" + - "0" + - - "2" + - "1" + - "-1.75" + - - "2" + - "1" + - "-0.25" + items: + - type: rect + bounds: [0, 0, 50, 50] + color: [135, 206, 235, 0.5] diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-composite-ref.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-composite-ref.yaml new file mode 100644 index 0000000000..25d9e7db6a --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-composite-ref.yaml @@ -0,0 +1,73 @@ +# Tests the composite SVG filter primitive +--- +root: + items: + - type: stacking-context + bounds: 0 0 0 0 + items: + - type: rect + color: yellow + bounds: 10 10 100 100 + - type: rect + color: blue + bounds: 60 60 100 100 + - type: stacking-context + bounds: 200 0 0 0 + items: + - type: rect + color: blue + bounds: 60 60 50 50 + - type: stacking-context + bounds: 400 0 0 0 + items: + - type: rect + color: yellow + bounds: 10 10 100 100 + - type: rect + color: blue + bounds: 60 60 50 50 + - type: stacking-context + bounds: 600 0 0 0 + items: + - type: rect + color: blue + bounds: 60 60 100 100 + - type: rect + color: white + bounds: 60 60 50 50 + - type: stacking-context + bounds: 0 200 0 0 + items: + - type: rect + color: yellow + bounds: 10 10 100 100 + - type: rect + color: blue + bounds: 60 60 100 100 + - type: rect + color: white + bounds: 60 60 50 50 + - type: stacking-context + bounds: 200 200 0 0 + items: + - type: rect + color: [255, 0, 0, 1.0] + bounds: 10 10 100 100 + - type: rect + color: [0, 0, 255, 1.0] + bounds: 60 60 100 100 + - type: rect + color: [255, 0, 255, 1.0] + bounds: 60 60 50 50 + - type: stacking-context + bounds: 400 200 0 0 + items: + - type: rect + color: [255, 255, 127, 1.0] + bounds: 10 10 100 100 + - type: rect + color: [127, 127, 255, 1.0] + bounds: 60 60 100 100 + - type: rect + color: [188, 188, 188, 1.0] + bounds: 60 60 50 50 diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-composite.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-composite.yaml new file mode 100644 index 0000000000..68f3cc0744 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-composite.yaml @@ -0,0 +1,124 @@ +# Tests the composite SVG filter primitive +--- +root: + items: + - type: stacking-context + bounds: 0 0 0 0 + filter-primitives: + - type: flood + color: yellow + in: previous + - type: offset + offset: -50 -50 + in: previous + - type: composite + in1: original + in2: 1 + operator: over + items: + - type: rect + color: blue + bounds: 60 60 100 100 + - type: stacking-context + bounds: 200 0 0 0 + filter-primitives: + - type: flood + color: yellow + in: previous + - type: offset + offset: -50 -50 + in: previous + - type: composite + in1: original + in2: 1 + operator: in + items: + - type: rect + color: blue + bounds: 60 60 100 100 + - type: stacking-context + bounds: 400 0 0 0 + filter-primitives: + - type: flood + color: yellow + in: previous + - type: offset + offset: -50 -50 + in: previous + - type: composite + in1: original + in2: 1 + operator: atop + items: + - type: rect + color: blue + bounds: 60 60 100 100 + - type: stacking-context + bounds: 600 0 0 0 + filter-primitives: + - type: flood + color: yellow + in: previous + - type: offset + offset: -50 -50 + in: previous + - type: composite + in1: original + in2: 1 + operator: out + items: + - type: rect + color: blue + bounds: 60 60 100 100 + - type: stacking-context + bounds: 0 200 0 0 + filter-primitives: + - type: flood + color: yellow + in: previous + - type: offset + offset: -50 -50 + in: previous + - type: composite + in1: original + in2: 1 + operator: xor + items: + - type: rect + color: blue + bounds: 60 60 100 100 + - type: stacking-context + bounds: 200 200 0 0 + filter-primitives: + - type: flood + color: [255, 0, 0, 1.0] + in: previous + - type: offset + offset: -50 -50 + in: previous + - type: composite + in1: original + in2: 1 + operator: lighter + items: + - type: rect + color: [0, 0, 255, 1.0] + bounds: 60 60 100 100 + - type: stacking-context + bounds: 400 200 0 0 + filter-primitives: + - type: flood + color: yellow + in: previous + - type: offset + offset: -50 -50 + in: previous + - type: composite + in1: original + in2: 1 + operator: arithmetic + k-values: [0.5, 0.5, 0.5, 0] + items: + - type: rect + color: blue + bounds: 60 60 100 100 diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-on-viewport-edge.png b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-on-viewport-edge.png Binary files differnew file mode 100644 index 0000000000..a63372edfb --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-on-viewport-edge.png diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-on-viewport-edge.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-on-viewport-edge.yaml new file mode 100644 index 0000000000..3b1a4da213 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-on-viewport-edge.yaml @@ -0,0 +1,16 @@ +--- +root: + items: + - type: stacking-context + bounds: [10, 10, 400, 400] + filter-primitives: + - type: drop-shadow + offset: [10, 10] + radius: 20 + color: [255, 0, 0, 1] + in: previous + color-space: srgb + items: + - type: rect + bounds: 0 0 256 256 + color: green diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-perspective.png b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-perspective.png Binary files differnew file mode 100644 index 0000000000..1015e7f4c0 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-perspective.png diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-perspective.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-perspective.yaml new file mode 100644 index 0000000000..744e2f655e --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-perspective.yaml @@ -0,0 +1,22 @@ +# Tests SVG drop shadows with perspective transforms +--- +root: + items: + - type: stacking-context + perspective: 100 + perspective-origin: 100 50 + items: + - type: "stacking-context" + transform-origin: 0 250 + transform: rotate-x(-15) + filter-primitives: + - type: drop-shadow + color: red + offset: [20, 20] + radius: 10 + in: previous + color-space: srgb + items: + - type: rect + color: blue + bounds: 0 0 200 200 diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-rotate-ref.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-rotate-ref.yaml new file mode 100644 index 0000000000..69501250a0 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-rotate-ref.yaml @@ -0,0 +1,11 @@ +# Tests SVG drop shadows with transforms +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 400, 400] + filters: drop-shadow([73, 73], 20, [255, 0, 0, 1]) + transform: rotate-z(45) + items: + - image: "firefox.png" + bounds: 0 0 256 256 diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-rotate.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-rotate.yaml new file mode 100644 index 0000000000..71acca0f52 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-rotate.yaml @@ -0,0 +1,17 @@ +# Tests SVG drop shadows with transforms +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 400, 400] + transform: rotate-z(45) + filter-primitives: + - type: drop-shadow + in: previous + offset: [73, 73] + radius: 20 + color: [255, 0, 0, 1] + color-space: srgb + items: + - image: "firefox.png" + bounds: 0 0 256 256 diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow.png b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow.png Binary files differnew file mode 100644 index 0000000000..eee62c79d2 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow.png diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow.yaml new file mode 100644 index 0000000000..25cdfaf61e --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow.yaml @@ -0,0 +1,16 @@ +# Tests that SVG drop shadows are working properly +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 400, 400] + filter-primitives: + - type: drop-shadow + in: previous + offset: [73, 73] + radius: 20 + color: [255, 0, 0, 1] + color-space: srgb + items: + - image: "firefox.png" + bounds: 0 0 256 256 diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-flood-ref.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-flood-ref.yaml new file mode 100644 index 0000000000..ae4eb6a0d1 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-flood-ref.yaml @@ -0,0 +1,10 @@ +# Test that flood filter is equivalent to drawing a rect with the same size and color +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 400, 400] + items: + - type: rect + bounds: [20, 20, 256, 256] + color: [0, 255.0, 0, 0.4] diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-flood.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-flood.yaml new file mode 100644 index 0000000000..bf896e266f --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-flood.yaml @@ -0,0 +1,10 @@ +# Test that flood filter is equivalent to drawing a rect with the same size and color +--- +root: + items: + - type: stacking-context + bounds: [100, 100, 400, 400] + filters: flood([0, 255.0, 0, 0.4]) + items: + - image: "firefox.png" + bounds: 20 20 256 256 diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-offset-ref.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-offset-ref.yaml new file mode 100644 index 0000000000..f6326b5134 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-offset-ref.yaml @@ -0,0 +1,11 @@ +# Tests the SVG offset filter primitive +# An offset filter should have the same effect as changing the origin of the rectangle. +--- +root: + items: + - type: stacking-context + bounds: 0 0 0 0 + items: + - type: rect + bounds: 20 20 100 100 + color: red diff --git a/gfx/wr/wrench/reftests/filters/svg-filter-offset.yaml b/gfx/wr/wrench/reftests/filters/svg-filter-offset.yaml new file mode 100644 index 0000000000..f48fb5104e --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-filter-offset.yaml @@ -0,0 +1,15 @@ +# Tests the SVG offset filter primitive +# An offset filter should have the same effect as changing the origin of the rectangle. +--- +root: + items: + - type: stacking-context + bounds: 0 0 0 0 + filter-primitives: + - type: offset + offset: 10 10 + in: original + items: + - type: rect + bounds: 10 10 100 100 + color: red diff --git a/gfx/wr/wrench/reftests/filters/svg-srgb-to-linear.yaml b/gfx/wr/wrench/reftests/filters/svg-srgb-to-linear.yaml new file mode 100644 index 0000000000..f7f33165f5 --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/svg-srgb-to-linear.yaml @@ -0,0 +1,20 @@ +# this test ensures that a sRGB -> linear-RGB -> sRGB results in no change (with exception to rounding error) +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 300, 100] + filter-primitives: + - type: identity + in: previous + color-space: linear-rgb + items: + - type: rect + bounds: [100, 0, 100, 100] + color: [200, 200, 200, 1.0] + - type: rect + bounds: [100, 0, 100, 100] + color: [100, 100, 100, 1.0] + - type: rect + bounds: [200, 0, 100, 100] + color: [50, 50, 50, 1.0] |