Skip to content

Commit

Permalink
Bug 1616106 - Add more tests and reference images for conic-gradient …
Browse files Browse the repository at this point in the history
…wrench test suite. r=nical

Differential Revision: https://phabricator.services.mozilla.com/D63213

--HG--
rename : gfx/wr/wrench/reftests/gradient/conic-start-angle.yaml => gfx/wr/wrench/reftests/gradient/conic-angle.yaml
extra : moz-landing-system : lando
  • Loading branch information
nt1m committed Feb 19, 2020
1 parent 0eaae42 commit 8ba9339
Show file tree
Hide file tree
Showing 36 changed files with 392 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 300 300
center: 150 150
angle: -5.497787143782138
stops: [0.0, red, 1.0, yellow]
8 changes: 8 additions & 0 deletions gfx/wr/wrench/reftests/gradient/conic-angle-wraparound.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 300 300
center: 150 150
angle: 7.0685834705770345
stops: [0.0, red, 1.0, yellow]
Binary file added gfx/wr/wrench/reftests/gradient/conic-angle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gfx/wr/wrench/reftests/gradient/conic-center.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions gfx/wr/wrench/reftests/gradient/conic-center.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
center: 50 50
angle: 0.0
stops: [0.0, red, 0.25, red,
0.25, green, 0.5, green,
0.5, blue, 0.75, blue,
0.75, black, 1.0, black]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions gfx/wr/wrench/reftests/gradient/conic-ref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
root:
items:
- type: stacking-context
bounds: 50 50 100 100
items:
- type: rect
bounds: 0 0 100 100
color: black
- type: rect
bounds: 100 0 100 100
color: red
- type: rect
bounds: 100 100 100 100
color: green
- type: rect
bounds: 0 100 100 100
color: blue
Binary file added gfx/wr/wrench/reftests/gradient/conic-simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions gfx/wr/wrench/reftests/gradient/conic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
center: 100 100
angle: 0.0
stops: [0.0, red, 0.25, red,
0.25, green, 0.5, green,
0.5, blue, 0.75, blue,
0.75, black, 1.0, black]
9 changes: 9 additions & 0 deletions gfx/wr/wrench/reftests/gradient/norm-conic-1-ref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
angle: 0.0
center: 100 100
stops: [0.0, green, 0.5, green,
0.5, blue, 1.0, blue]
9 changes: 9 additions & 0 deletions gfx/wr/wrench/reftests/gradient/norm-conic-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
angle: 0.0
center: 100 100
stops: [0.25, green, 0.5, green,
0.5, blue, 0.75, blue]
9 changes: 9 additions & 0 deletions gfx/wr/wrench/reftests/gradient/norm-conic-2-ref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
angle: 0.0
center: 100 100
stops: [0.0, green, 0.5, green,
0.5, blue, 1.0, blue]
9 changes: 9 additions & 0 deletions gfx/wr/wrench/reftests/gradient/norm-conic-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
angle: 0.0
center: 100 100
stops: [0.5, green,
0.5, blue]
8 changes: 8 additions & 0 deletions gfx/wr/wrench/reftests/gradient/norm-conic-3-ref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
angle: 0.0
center: 100 100
stops: [0.0, blue, 1.0, blue]
9 changes: 9 additions & 0 deletions gfx/wr/wrench/reftests/gradient/norm-conic-3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
angle: 0.0
center: 100 100
stops: [-0.5, green,
-0.5, blue]
8 changes: 8 additions & 0 deletions gfx/wr/wrench/reftests/gradient/norm-conic-4-ref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
angle: 0.0
center: 100 100
stops: [0.0, green, 1.0, green]
9 changes: 9 additions & 0 deletions gfx/wr/wrench/reftests/gradient/norm-conic-4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
angle: 0.0
center: 100 100
stops: [1.5, green,
1.5, blue]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 300 300
angle: 0.0
center: 150 150
stops: [0.0, red, 1.0, red]
14 changes: 14 additions & 0 deletions gfx/wr/wrench/reftests/gradient/norm-conic-degenerate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# see: https://www.w3.org/TR/2012/CR-css3-images-20120417/#repeating-gradients
# the spec says that repeating gradients with color stops in the same offset
# must render as a solid rect with color equal to the average color of the
# gradient. Gecko and Blink seem to draw it with color equal to the last stop
# so that is the behavior tested here
---
root:
items:
- type: conic-gradient
bounds: 50 50 300 300
angle: 0.0
center: 150 150
stops: [0.5, blue, 0.5, red]
repeat: true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions gfx/wr/wrench/reftests/gradient/premultiplied-conic-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
angle: 0.0
center: 100 100
stops: [0.0, [255.0, 0.0, 0.0, 0.5], 0.5, [0.0, 255.0, 0.0, 0.5], 1.0, [0.0, 0.0, 255.0, 0.5]]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions gfx/wr/wrench/reftests/gradient/premultiplied-conic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 200 200
angle: 0.0
center: 100 100
stops: [0.0, red, 0.5, [0.0, 0.0, 0.0, 0.0], 1.0, green]
23 changes: 23 additions & 0 deletions gfx/wr/wrench/reftests/gradient/reftest.list
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
platform(linux,mac) == premultiplied-aligned.yaml premultiplied-aligned.png
platform(linux,mac) == premultiplied-angle.yaml premultiplied-angle.png
platform(linux,mac) == premultiplied-radial.yaml premultiplied-radial.png
platform(linux,mac) == premultiplied-conic.yaml premultiplied-conic.png

platform(linux,mac) == premultiplied-aligned-2.yaml premultiplied-aligned-2.png
platform(linux,mac) == premultiplied-angle-2.yaml premultiplied-angle-2.png
platform(linux,mac) == premultiplied-radial-2.yaml premultiplied-radial-2.png
platform(linux,mac) == premultiplied-conic-2.yaml premultiplied-conic-2.png

== linear.yaml linear-ref.png
== linear-reverse.yaml linear-ref.png
Expand Down Expand Up @@ -38,12 +40,22 @@ platform(linux,mac) fuzzy(1,80000) == radial-ellipse.yaml radial-ellipse-ref.png
== norm-radial-3.yaml norm-radial-3-ref.yaml
== norm-radial-degenerate.yaml norm-radial-degenerate-ref.yaml

== norm-conic-1.yaml norm-conic-1-ref.yaml
== norm-conic-2.yaml norm-conic-2-ref.yaml
# Bug 1616255 - These should pass
# == norm-conic-3.yaml norm-conic-3-ref.yaml
# == norm-conic-4.yaml norm-conic-4-ref.yaml
== norm-conic-degenerate.yaml norm-conic-degenerate-ref.yaml

# fuzzy because of differences from normalization
# this might be able to be improved
fuzzy(255,1200) == repeat-linear.yaml repeat-linear-ref.yaml
fuzzy(255,1200) == repeat-linear-reverse.yaml repeat-linear-ref.yaml
fuzzy(255,2664) == repeat-radial.yaml repeat-radial-ref.yaml
fuzzy(255,2664) == repeat-radial-negative.yaml repeat-radial-ref.yaml
# Bug 1616255 - These should pass
# == repeat-conic.yaml repeat-conic-ref.yaml
# == repeat-conic-negative.yaml repeat-conic-ref.yaml

# fuzzy because of thin spaced out column of pixels that are 1 off
fuzzy(1,83164) == tiling-linear-1.yaml tiling-linear-1-ref.yaml
Expand All @@ -55,10 +67,21 @@ fuzzy(1,1) == tiling-radial-2.yaml tiling-radial-2-ref.yaml
fuzzy(1,3) == tiling-radial-3.yaml tiling-radial-3-ref.yaml
fuzzy(1,17) == tiling-radial-4.yaml tiling-radial-4-ref.yaml

fuzzy(1,17) == tiling-conic-1.yaml tiling-conic-1-ref.yaml
fuzzy(1,1) == tiling-conic-2.yaml tiling-conic-2-ref.yaml
fuzzy(1,3) == tiling-conic-3.yaml tiling-conic-3-ref.yaml

== radial-zero-size-1.yaml radial-zero-size-ref.yaml
== radial-zero-size-2.yaml radial-zero-size-ref.yaml
== radial-zero-size-3.yaml radial-zero-size-ref.yaml

platform(linux,mac) == linear-aligned-border-radius.yaml linear-aligned-border-radius.png
platform(linux,mac) == repeat-border-radius.yaml repeat-border-radius.png

== conic.yaml conic-ref.yaml
fuzzy(1,56) == conic-simple.yaml conic-simple.png
fuzzy(255,166) == conic-angle.yaml conic-angle.png
== conic-center.yaml conic-center.png
fuzzy(1,1) == conic-angle-wraparound.yaml conic-angle.yaml
fuzzy(1,1) == conic-angle-wraparound-negative.yaml conic-angle.yaml
fuzzy(1,115) == conic-color-wheel.yaml conic-color-wheel.png
Binary file modified gfx/wr/wrench/reftests/gradient/repeat-border-radius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions gfx/wr/wrench/reftests/gradient/repeat-border-radius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,49 @@ root:
center: 50 50
radius: 25 25
stops: [0.0, red, 1.0, yellow]

- type: clip
bounds: [20, 300, 100, 100]
complex:
- rect: [20, 300, 100, 100]
radius: 32
items:
- type: conic-gradient
bounds: 20 300 100 100
angle: 0.0
center: 50 50
stops: [0.0, red, 1.0, yellow]
repeat: true

- type: rect
bounds: [130, 290, 120, 120]
color: blue

- type: clip
bounds: [140, 300, 100, 100]
complex:
- rect: [140, 300, 100, 100]
radius: 32
items:
- type: conic-gradient
bounds: 140 300 100 100
angle: 0.0
center: 50 50
stops: [0.0, red, 1.0, yellow]

- type: rect
bounds: [260, 290, 120, 120]
color: black

- type: clip
bounds: [270, 300, 100, 100]
complex:
- rect: [270, 300, 100, 100]
radius: 32
items:
- type: conic-gradient
bounds: 270 300 100 100
angle: 0.0
center: 50 50
stops: [0.0, red, 1.0, yellow]

9 changes: 9 additions & 0 deletions gfx/wr/wrench/reftests/gradient/repeat-conic-negative.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 300 300
angle: -0.62831853
center: 150 150
stops: [0.1, red, 0.2, red, 0.2, blue, 0.3, blue]
repeat: true
27 changes: 27 additions & 0 deletions gfx/wr/wrench/reftests/gradient/repeat-conic-ref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 300 300
angle: 0.0
center: 150 150
stops: [0.0, red,
0.1, red,
0.1, blue,
0.2, blue,
0.2, red,
0.3, red,
0.3, blue,
0.4, blue,
0.4, red,
0.5, red,
0.5, blue,
0.6, blue,
0.6, red,
0.7, red,
0.7, blue,
0.8, blue,
0.8, red,
0.9, red,
0.9, blue,
1.0, blue]
9 changes: 9 additions & 0 deletions gfx/wr/wrench/reftests/gradient/repeat-conic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
root:
items:
- type: conic-gradient
bounds: 50 50 300 300
angle: 0.0
center: 150 150
stops: [0.1, blue, 0.2, blue, 0.2, red, 0.3, red]
repeat: true
27 changes: 27 additions & 0 deletions gfx/wr/wrench/reftests/gradient/tiling-conic-1-ref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
root:
items:
# top left
- type: conic-gradient
bounds: 50 50 200 200
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]
# top right
- type: conic-gradient
bounds: 350 50 200 200
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]
# bottom left
- type: conic-gradient
bounds: 50 350 200 200
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]
# bottom right
- type: conic-gradient
bounds: 350 350 200 200
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]
11 changes: 11 additions & 0 deletions gfx/wr/wrench/reftests/gradient/tiling-conic-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
root:
items:
# basic - 4 tiles spaced out with no clipping
- type: conic-gradient
bounds: 50 50 500 500
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]
tile-size: 200 200
tile-spacing: 100 100
Loading

0 comments on commit 8ba9339

Please sign in to comment.