Bug 1616106 - Add more tests and reference images for conic-gradient 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
This commit is contained in:
Tim Nguyen 2020-02-19 11:26:19 +00:00
Родитель 0eaae4241d
Коммит 8ba933913f
36 изменённых файлов: 392 добавлений и 0 удалений

Просмотреть файл

@ -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]

Просмотреть файл

@ -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]

Двоичные данные
gfx/wr/wrench/reftests/gradient/conic-angle.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 24 KiB

Двоичные данные
gfx/wr/wrench/reftests/gradient/conic-center.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.0 KiB

Просмотреть файл

@ -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]

Двоичные данные
gfx/wr/wrench/reftests/gradient/conic-color-wheel.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 35 KiB

Просмотреть файл

@ -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

Двоичные данные
gfx/wr/wrench/reftests/gradient/conic-simple.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 24 KiB

Просмотреть файл

@ -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]

Просмотреть файл

@ -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]

Просмотреть файл

@ -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]

Просмотреть файл

@ -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]

Просмотреть файл

@ -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]

Просмотреть файл

@ -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]

Просмотреть файл

@ -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]

Просмотреть файл

@ -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]

Просмотреть файл

@ -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]

Просмотреть файл

@ -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]

Просмотреть файл

@ -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

Двоичные данные
gfx/wr/wrench/reftests/gradient/premultiplied-conic-2.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 14 KiB

Просмотреть файл

@ -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]]

Двоичные данные
gfx/wr/wrench/reftests/gradient/premultiplied-conic.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 16 KiB

Просмотреть файл

@ -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]

Просмотреть файл

@ -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
@ -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
@ -55,6 +67,10 @@ 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
@ -62,3 +78,10 @@ fuzzy(1,17) == tiling-radial-4.yaml tiling-radial-4-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

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 16 KiB

После

Ширина:  |  Высота:  |  Размер: 31 KiB

Просмотреть файл

@ -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]

Просмотреть файл

@ -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

Просмотреть файл

@ -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]

Просмотреть файл

@ -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

Просмотреть файл

@ -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]

Просмотреть файл

@ -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

Просмотреть файл

@ -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 100 200
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]
# bottom left
- type: conic-gradient
bounds: 50 350 200 100
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]
# bottom right
- type: conic-gradient
bounds: 350 350 100 100
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]

Просмотреть файл

@ -0,0 +1,11 @@
---
root:
items:
# slightly clip the last tile
- type: conic-gradient
bounds: 50 50 400 400
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]
tile-size: 200 200
tile-spacing: 100 100

Просмотреть файл

@ -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: 250 50 200 200
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]
# bottom left
- type: conic-gradient
bounds: 50 250 200 100
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]
# bottom right
- type: conic-gradient
bounds: 250 250 200 100
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]

Просмотреть файл

@ -0,0 +1,11 @@
---
root:
items:
# no spacing with a clip
- type: conic-gradient
bounds: 50 50 400 300
angle: 0.0
center: 100 100
stops: [0, red, 1, blue]
tile-size: 200 200
tile-spacing: 0 0