Bug 1555483 - Part 5: Add wrench reftests for SVG filters and update test expectations r=gw
☠☠ backed out by 27679131d486 ☠ ☠
authorConnor Brewster <cbrewster@mozilla.com>
Wed, 10 Jul 2019 02:17:17 +0000
changeset 482265 8149efc1f8131d09db617e82c9e6fbde25cccd0c
parent 482264 917f800e4e43a0dc4799dd5893d4fa4b96454857
child 482266 4d8a44b52bb6773ba7bf346efe44afc3056ef4d5
push id89660
push usercsabou@mozilla.com
push dateWed, 10 Jul 2019 19:47:03 +0000
treeherderautoland@8149efc1f813 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw
bugs1555483
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1555483 - Part 5: Add wrench reftests for SVG filters and update test expectations r=gw Differential Revision: https://phabricator.services.mozilla.com/D35742
gfx/wr/wrench/reftests/filters/filter-flood-ref.yaml
gfx/wr/wrench/reftests/filters/filter-flood.yaml
gfx/wr/wrench/reftests/filters/reftest.list
gfx/wr/wrench/reftests/filters/svg-filter-blend-ref.yaml
gfx/wr/wrench/reftests/filters/svg-filter-blend.yaml
gfx/wr/wrench/reftests/filters/svg-filter-blur-transforms.png
gfx/wr/wrench/reftests/filters/svg-filter-blur-transforms.yaml
gfx/wr/wrench/reftests/filters/svg-filter-blur.yaml
gfx/wr/wrench/reftests/filters/svg-filter-color-matrix.yaml
gfx/wr/wrench/reftests/filters/svg-filter-component-transfer.yaml
gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-on-viewport-edge.png
gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-on-viewport-edge.yaml
gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-perspective.png
gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-perspective.yaml
gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-rotate-ref.yaml
gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow-rotate.yaml
gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow.png
gfx/wr/wrench/reftests/filters/svg-filter-drop-shadow.yaml
gfx/wr/wrench/reftests/filters/svg-filter-flood-ref.yaml
gfx/wr/wrench/reftests/filters/svg-filter-flood.yaml
gfx/wr/wrench/reftests/filters/svg-srgb-to-linear.yaml
gfx/wr/wrench/reftests/mask/reftest.list
--- a/gfx/wr/wrench/reftests/filters/reftest.list
+++ b/gfx/wr/wrench/reftests/filters/reftest.list
@@ -39,9 +39,19 @@ platform(linux,mac) == filter-drop-shado
 == iframe-dropshadow.yaml iframe-dropshadow-ref.yaml
 skip_on(android) == filter-mix-blend-mode.yaml filter-mix-blend-mode-ref.yaml  # Android debug: GL error 502 at blit_framebuffer (emulator) or draw_elements_instanced (Pixel2); Android opt: fails
 == 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-blur-scaled.yaml filter-blur-scaled-ref.yaml
 skip_on(android) == filter-blur-scaled-xonly.yaml filter-blur-scaled-xonly.png  # fails on Android emulator and Pixel2
-== filter-flood.yaml filter-flood-ref.yaml
+skip_on(android,emulator) == svg-filter-component-transfer.yaml filter-component-transfer-ref.yaml  # fails on Android emulator
+== svg-filter-flood.yaml svg-filter-flood-ref.yaml
+skip_on(android) == 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(4,28250) svg-filter-drop-shadow-rotate.yaml svg-filter-drop-shadow-rotate-ref.yaml
+platform(linux,mac) == 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
+platform(linux,mac) == svg-filter-drop-shadow-perspective.yaml svg-filter-drop-shadow-perspective.png
new file mode 100644
--- /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]
new file mode 100644
--- /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]
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/filters/svg-filter-blur-transforms.yaml
@@ -0,0 +1,15 @@
+---
+root:
+  items:
+    - type: stacking-context
+      bounds: [0, 100, 300, 300]
+      transform: scale-x(0.1) rotate-z(45)
+      filter-primitives:
+      - type: blur
+        radius: 10
+        in: previous
+        color-space: srgb
+      items:
+      - type: rect
+        color: red
+        bounds: 0 0 256 256
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/filters/svg-filter-blur.yaml
@@ -0,0 +1,13 @@
+---
+root:
+  items:
+    - type: stacking-context
+      bounds: [100, 100, 300, 300]
+      filter-primitives:
+      - type: blur
+        radius: 10
+        in: previous
+        color-space: srgb
+      items:
+      - image: "firefox.png"
+        bounds: 20 20 256 256
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/filters/svg-filter-color-matrix.yaml
@@ -0,0 +1,54 @@
+---
+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]
+          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]
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/filters/svg-filter-component-transfer.yaml
@@ -0,0 +1,128 @@
+---
+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]
new file mode 100644
new file mode 100644
--- /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
new file mode 100644
new file mode 100644
--- /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
new file mode 100644
--- /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
new file mode 100644
--- /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
new file mode 100644
new file mode 100644
--- /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
rename from gfx/wr/wrench/reftests/filters/filter-flood-ref.yaml
rename to gfx/wr/wrench/reftests/filters/svg-filter-flood-ref.yaml
rename from gfx/wr/wrench/reftests/filters/filter-flood.yaml
rename to gfx/wr/wrench/reftests/filters/svg-filter-flood.yaml
new file mode 100644
--- /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]
--- a/gfx/wr/wrench/reftests/mask/reftest.list
+++ b/gfx/wr/wrench/reftests/mask/reftest.list
@@ -5,12 +5,12 @@ skip_on(android,emulator) == nested-mask
 != mask.yaml green.yaml
 == aligned-layer-rect.yaml aligned-layer-rect-ref.yaml
 == mask-transformed-to-empty-rect.yaml mask-transformed-to-empty-rect-ref.yaml
 platform(linux,mac) == rounded-corners.yaml rounded-corners.png
 != mask.yaml out-of-bounds.yaml
 platform(linux,mac) fuzzy(1,17500) color_targets(3) alpha_targets(1) == mask-atomicity.yaml mask-atomicity-ref.yaml
 platform(linux,mac) fuzzy(1,17500) == mask-atomicity-tiling.yaml mask-atomicity-ref.yaml
 platform(linux,mac) == mask-perspective.yaml mask-perspective.png
-skip_on(android,emulator) == fuzzy(1,6) mask-perspective-tiling.yaml mask-perspective.yaml  # Android emulator: GL error 502 at tex_sub_image_3d_pbo, fails on opt
+skip_on(android,emulator) == fuzzy(1,7) mask-perspective-tiling.yaml mask-perspective.yaml  # Android emulator: GL error 502 at tex_sub_image_3d_pbo, fails on opt
 platform(linux,mac) == checkerboard.yaml checkerboard.png
 skip_on(android) == checkerboard.yaml checkerboard-tiling.yaml  # Android emulator: GL error 502 at blit_framebuffer, fails on opt emulator and on a Pixel2
 == missing-mask.yaml missing-mask-ref.yaml