diff options
Diffstat (limited to '')
28 files changed, 363 insertions, 0 deletions
diff --git a/gfx/wr/wrench/reftests/mask/aligned-layer-rect-ref.yaml b/gfx/wr/wrench/reftests/mask/aligned-layer-rect-ref.yaml new file mode 100644 index 0000000000..d4ef946d7c --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/aligned-layer-rect-ref.yaml @@ -0,0 +1,8 @@ +--- +root: + items: + - type: stacking-context + items: + - type: rect + bounds: [9, 9, 10, 10] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/aligned-layer-rect.yaml b/gfx/wr/wrench/reftests/mask/aligned-layer-rect.yaml new file mode 100644 index 0000000000..a1c6e2f17e --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/aligned-layer-rect.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: scroll-frame + bounds: [9, 9, 10, 10] + content-size: [95, 88] + items: + - type: scroll-frame + bounds: [0, 0, 100, 100] + items: + - type: rect + bounds: [0, 0, 100, 100] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/checkerboard-tiling.yaml b/gfx/wr/wrench/reftests/mask/checkerboard-tiling.yaml new file mode 100644 index 0000000000..782babbef6 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/checkerboard-tiling.yaml @@ -0,0 +1,16 @@ +# Tests a tiled image mask with leftover tile offsets. +--- +root: + items: + - type: clip + bounds: [0, 0, 200, 200] + image-mask: + image: transparent-checkerboard(2, 16, 16) + rect: [0, 0, 200, 200] + repeat: false + # This is the point of the test, can't be a divisor of 200. + tile-size: 37 + items: + - type: rect + bounds: [0, 0, 200, 200] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/checkerboard.png b/gfx/wr/wrench/reftests/mask/checkerboard.png Binary files differnew file mode 100644 index 0000000000..f2c45c3194 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/checkerboard.png diff --git a/gfx/wr/wrench/reftests/mask/checkerboard.yaml b/gfx/wr/wrench/reftests/mask/checkerboard.yaml new file mode 100644 index 0000000000..980bdb13fe --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/checkerboard.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: clip + bounds: [0, 0, 200, 200] + image-mask: + image: transparent-checkerboard(2, 16, 16) + rect: [0, 0, 200, 200] + repeat: false + items: + - type: rect + bounds: [0, 0, 200, 200] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/green.yaml b/gfx/wr/wrench/reftests/mask/green.yaml new file mode 100644 index 0000000000..0d3df60582 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/green.yaml @@ -0,0 +1,6 @@ +--- +root: + items: + - type: rect + bounds: [0, 0, 95, 88] + color: green diff --git a/gfx/wr/wrench/reftests/mask/mask-atomicity-ref.yaml b/gfx/wr/wrench/reftests/mask/mask-atomicity-ref.yaml new file mode 100644 index 0000000000..81480856c0 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask-atomicity-ref.yaml @@ -0,0 +1,17 @@ +--- +root: + items: + - type: rect + bounds: [25, 25, 100, 100] + color: red + - type: stacking-context + bounds: [0, 0, 200, 200] + filters: + - "opacity(0.5)" + items: + - type: rect + bounds: [0, 0, 100, 100] + color: blue + - type: rect + bounds: [50, 50, 100, 100] + color: green diff --git a/gfx/wr/wrench/reftests/mask/mask-atomicity-tiling.yaml b/gfx/wr/wrench/reftests/mask/mask-atomicity-tiling.yaml new file mode 100644 index 0000000000..f44b4ab3ce --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask-atomicity-tiling.yaml @@ -0,0 +1,25 @@ +--- +root: + items: + - type: rect + bounds: [25, 25, 100, 100] + color: red + - type: clip + bounds: [0, 0, 200, 200] + id: 2 + image-mask: + # premultiplied 0.5 alpha white(??) + image: solid-color(127,127,127,127,200,200) + rect: [0, 0, 200, 200] + tile-size: 10 + repeat: false + - type: stacking-context + bounds: [0, 0, 200, 200] + clip-node: 2 + items: + - type: rect + bounds: [0, 0, 100, 100] + color: blue + - type: rect + bounds: [50, 50, 100, 100] + color: green diff --git a/gfx/wr/wrench/reftests/mask/mask-atomicity.yaml b/gfx/wr/wrench/reftests/mask/mask-atomicity.yaml new file mode 100644 index 0000000000..269030e361 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask-atomicity.yaml @@ -0,0 +1,24 @@ +--- +root: + items: + - type: rect + bounds: [25, 25, 100, 100] + color: red + - type: clip + bounds: [0, 0, 200, 200] + id: 2 + image-mask: + # premultiplied 0.5 alpha white(??) + image: solid-color(127,127,127,127,200,200) + rect: [0, 0, 200, 200] + repeat: false + - type: stacking-context + bounds: [0, 0, 200, 200] + clip-node: 2 + items: + - type: rect + bounds: [0, 0, 100, 100] + color: blue + - type: rect + bounds: [50, 50, 100, 100] + color: green diff --git a/gfx/wr/wrench/reftests/mask/mask-perspective-tiling.yaml b/gfx/wr/wrench/reftests/mask/mask-perspective-tiling.yaml new file mode 100644 index 0000000000..bd0fad7af9 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask-perspective-tiling.yaml @@ -0,0 +1,23 @@ +--- +root: + items: + - + type: stacking-context + perspective: 1 + perspective-origin: 0 0 + items: + - + type: stacking-context + transform: 10 0 0 0 0 10 0 0 0 0 10 0 0 0 -9 1 + items: + - type: clip + bounds: [0, 0, 95, 88] + image-mask: + image: "mask.png" + rect: [0, 0, 35, 35] + repeat: false + tile-size: 5 + items: + - type: rect + bounds: [0, 0, 95, 88] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/mask-perspective.png b/gfx/wr/wrench/reftests/mask/mask-perspective.png Binary files differnew file mode 100644 index 0000000000..edec10eae3 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask-perspective.png diff --git a/gfx/wr/wrench/reftests/mask/mask-perspective.yaml b/gfx/wr/wrench/reftests/mask/mask-perspective.yaml new file mode 100644 index 0000000000..e8d8e4d5d4 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask-perspective.yaml @@ -0,0 +1,22 @@ +--- +root: + items: + - + type: stacking-context + perspective: 1 + perspective-origin: 0 0 + items: + - + type: stacking-context + transform: 10 0 0 0 0 10 0 0 0 0 10 0 0 0 -9 1 + items: + - type: clip + bounds: [0, 0, 95, 88] + image-mask: + image: "mask.png" + rect: [0, 0, 35, 35] + repeat: false + items: + - type: rect + bounds: [0, 0, 95, 88] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/mask-ref.yaml b/gfx/wr/wrench/reftests/mask/mask-ref.yaml new file mode 100644 index 0000000000..01c4e60946 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask-ref.yaml @@ -0,0 +1,9 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 95, 88] + items: + - type: rect + bounds: [9, 9, 10, 10] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/mask-tiling.yaml b/gfx/wr/wrench/reftests/mask/mask-tiling.yaml new file mode 100644 index 0000000000..021ec9fa28 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask-tiling.yaml @@ -0,0 +1,14 @@ +--- +root: + items: + - type: clip + bounds: [0, 0, 95, 88] + image-mask: + image: "mask.png" + rect: [0, 0, 35, 35] + repeat: false + tile-size: 5 + items: + - type: rect + bounds: [0, 0, 95, 88] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/mask-transformed-to-empty-rect-ref.yaml b/gfx/wr/wrench/reftests/mask/mask-transformed-to-empty-rect-ref.yaml new file mode 100644 index 0000000000..1df66453d6 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask-transformed-to-empty-rect-ref.yaml @@ -0,0 +1,6 @@ +--- +root: + items: + - type: rect + bounds: [0, 0, 100, 100] + color: 0 255 0 1.0 diff --git a/gfx/wr/wrench/reftests/mask/mask-transformed-to-empty-rect.yaml b/gfx/wr/wrench/reftests/mask/mask-transformed-to-empty-rect.yaml new file mode 100644 index 0000000000..a291c1fb96 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask-transformed-to-empty-rect.yaml @@ -0,0 +1,26 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 300, 300] + "scroll-policy": scrollable + z-index: 4 + transform: [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 150, -150, 1] + items: + - type: clip + bounds: [0, 0, 300, 300] + # This image mask here assures that we will be forced to try to + # mask instead of skipping it due to the mask rect becoming a + # zero rect. + image-mask: + image: "tiny-check-mask.png" + rect: [0, 0, 300, 300] + repeat: false + id: 2 + items: + - type: rect + bounds: [0, 0, 300, 300] + color: 0 128 0 1.0000 + - type: rect + bounds: [0, 0, 100, 100] + color: 0 255 0 1.0 diff --git a/gfx/wr/wrench/reftests/mask/mask.png b/gfx/wr/wrench/reftests/mask/mask.png Binary files differnew file mode 100644 index 0000000000..ab1bdb9b50 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask.png diff --git a/gfx/wr/wrench/reftests/mask/mask.yaml b/gfx/wr/wrench/reftests/mask/mask.yaml new file mode 100644 index 0000000000..b7432f5827 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/mask.yaml @@ -0,0 +1,13 @@ +--- +root: + items: + - type: clip + bounds: [0, 0, 95, 88] + image-mask: + image: "mask.png" + rect: [0, 0, 35, 35] + repeat: false + items: + - type: rect + bounds: [0, 0, 95, 88] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/missing-mask-ref.yaml b/gfx/wr/wrench/reftests/mask/missing-mask-ref.yaml new file mode 100644 index 0000000000..112da9c9d1 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/missing-mask-ref.yaml @@ -0,0 +1,7 @@ +# Don't crash when supplied an invalid image key for the mask! +--- +root: + items: + - type: rect + bounds: [0, 0, 35, 35] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/missing-mask.yaml b/gfx/wr/wrench/reftests/mask/missing-mask.yaml new file mode 100644 index 0000000000..124c2cd893 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/missing-mask.yaml @@ -0,0 +1,14 @@ +# Don't crash when supplied an invalid image key for the mask! +--- +root: + items: + - type: clip + bounds: [0, 0, 95, 88] + image-mask: + image: invalid + rect: [0, 0, 35, 35] + repeat: false + items: + - type: rect + bounds: [0, 0, 95, 88] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/nested-mask-ref.yaml b/gfx/wr/wrench/reftests/mask/nested-mask-ref.yaml new file mode 100644 index 0000000000..c16df79e4c --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/nested-mask-ref.yaml @@ -0,0 +1,9 @@ +--- +root: + items: + - type: stacking-context + bounds: [0, 0, 95, 88] + items: + - type: rect + bounds: [13, 13, 6, 6] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/nested-mask-tiling.yaml b/gfx/wr/wrench/reftests/mask/nested-mask-tiling.yaml new file mode 100644 index 0000000000..0e70758f58 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/nested-mask-tiling.yaml @@ -0,0 +1,22 @@ +--- +root: + items: + - type: clip + bounds: [0, 0, 95, 88] + image-mask: + image: "mask.png" + rect: [0, 0, 35, 35] + repeat: false + tile-size: 5 + items: + - type: clip + bounds: [0, 0, 95, 88] + image-mask: + image: "mask.png" + rect: [4, 4, 35, 35] + repeat: false + tile-size: 5 + items: + - type: rect + bounds: [0, 0, 95, 88] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/nested-mask.yaml b/gfx/wr/wrench/reftests/mask/nested-mask.yaml new file mode 100644 index 0000000000..cacbb63434 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/nested-mask.yaml @@ -0,0 +1,20 @@ +--- +root: + items: + - type: clip + bounds: [0, 0, 95, 88] + image-mask: + image: "mask.png" + rect: [0, 0, 35, 35] + repeat: false + items: + - type: clip + bounds: [0, 0, 95, 88] + image-mask: + image: "mask.png" + rect: [4, 4, 35, 35] + repeat: false + items: + - type: rect + bounds: [0, 0, 95, 88] + color: blue diff --git a/gfx/wr/wrench/reftests/mask/out-of-bounds.yaml b/gfx/wr/wrench/reftests/mask/out-of-bounds.yaml new file mode 100644 index 0000000000..8e0eed09e0 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/out-of-bounds.yaml @@ -0,0 +1,16 @@ +--- +root: + items: + - type: clip + bounds: [0, 0, 10000, 10000] + complex: + - rect: [0, 0, 10000, 10000] + radius: + top-left: [30, 30] + top-right: [30, 30] + bottom-right: [30, 30] + bottom-left: [30, 30] + items: + - type: rect + bounds: [0, 0, 10000, 10000] + color: green diff --git a/gfx/wr/wrench/reftests/mask/reftest.list b/gfx/wr/wrench/reftests/mask/reftest.list new file mode 100644 index 0000000000..eb3bb3641d --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/reftest.list @@ -0,0 +1,16 @@ +fuzzy(1,10) == mask.yaml mask-ref.yaml +fuzzy(1,10) == mask-tiling.yaml mask-ref.yaml +fuzzy(1,10) == nested-mask.yaml nested-mask-ref.yaml +== nested-mask-tiling.yaml nested-mask-ref.yaml +!= 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 +== fuzzy(1,11) mask-perspective-tiling.yaml mask-perspective.yaml +platform(linux,mac) == checkerboard.yaml checkerboard.png +skip_on(android,device) == checkerboard.yaml checkerboard-tiling.yaml # Fails on a Pixel2 +== missing-mask.yaml missing-mask-ref.yaml diff --git a/gfx/wr/wrench/reftests/mask/rounded-corners.png b/gfx/wr/wrench/reftests/mask/rounded-corners.png Binary files differnew file mode 100644 index 0000000000..19adfe02ec --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/rounded-corners.png diff --git a/gfx/wr/wrench/reftests/mask/rounded-corners.yaml b/gfx/wr/wrench/reftests/mask/rounded-corners.yaml new file mode 100644 index 0000000000..e26a656cc0 --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/rounded-corners.yaml @@ -0,0 +1,24 @@ +--- +root: + items: + - type: clip + bounds: [0, 0, 100, 100] + complex: + - rect: [0, 0, 100, 100] + radius: + top-left: [30, 30] + top-right: [30, 30] + bottom-right: [30, 30] + bottom-left: [30, 30] + items: + - type: border + bounds: [0, 0, 100, 100] + width: [5, 5, 5, 5] + border-type: normal + style: [solid, solid, solid, solid] + color: [blue, blue, blue, blue] + radius: + top-left: [30, 30] + top-right: [30, 30] + bottom-right: [0, 0] + bottom-left: [0, 0] diff --git a/gfx/wr/wrench/reftests/mask/tiny-check-mask.png b/gfx/wr/wrench/reftests/mask/tiny-check-mask.png Binary files differnew file mode 100644 index 0000000000..d6f6e3548d --- /dev/null +++ b/gfx/wr/wrench/reftests/mask/tiny-check-mask.png |