diff options
Diffstat (limited to 'testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.html')
-rw-r--r-- | testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.html new file mode 100644 index 0000000000..e5efc24bcc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<link rel="match" href="2d.layer.ctm.filter-expected.html"> +<title>Canvas test: 2d.layer.ctm.filter</title> +<h1>2d.layer.ctm.filter</h1> +<p class="desc">Checks that parent transforms affect layer filters.</p> +<canvas id="canvas" width="200" height="200"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = new OffscreenCanvas(200, 200); + const ctx = canvas.getContext('2d'); + + // Transforms inside the layer should not apply to the layer's filter. + ctx.beginLayer({filter: 'drop-shadow(5px 5px 0px grey)'}); + ctx.translate(30, 90); + ctx.scale(2, 2); + ctx.rotate(Math.PI / 2); + ctx.fillRect(-30, -5, 60, 10); + ctx.endLayer(); + + // Transforms in the layer's parent should apply to the layer's filter. + ctx.translate(80, 90); + ctx.scale(2, 2); + ctx.rotate(Math.PI / 2); + ctx.beginLayer({filter: 'drop-shadow(5px 5px 0px grey)'}); + ctx.fillRect(-30, -5, 60, 10); + ctx.endLayer(); + + const outputCanvas = document.getElementById("canvas"); + outputCanvas.getContext('2d').drawImage(canvas, 0, 0); +</script> |