| Index: third_party/WebKit/LayoutTests/csspaint/paint2d-gradient-shadow.html
|
| diff --git a/third_party/WebKit/LayoutTests/csspaint/paint2d-gradient-shadow.html b/third_party/WebKit/LayoutTests/csspaint/paint2d-gradient-shadow.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6c1990fdef8f74e6d4a0e16dbc4c11f2f701f134
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/csspaint/paint2d-gradient-shadow.html
|
| @@ -0,0 +1,65 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="../resources/run-after-layout-and-paint.js"></script>
|
| +<style>
|
| + #output {
|
| + width: 500px;
|
| + height: 500px;
|
| + background-image: paint(shapes);
|
| + }
|
| +</style>
|
| +</head>
|
| +<body>
|
| +<div id="output"></div>
|
| +
|
| +<script id="code" type="text/worklet">
|
| +registerPaint('shapes', class {
|
| + paint(ctx) {
|
| + var fillShape = function(x, y) {
|
| + ctx.beginPath();
|
| + ctx.arc(x, y, 100, 0, Math.PI*2, true);
|
| + ctx.arc(x, y, 50, 0, Math.PI*2, false);
|
| + ctx.fill();
|
| + };
|
| +
|
| + var gradient = ctx.createLinearGradient(0, 0, 300, 0);
|
| + gradient.addColorStop(0, 'rgba(0, 0, 255, 0.5)');
|
| + gradient.addColorStop(1, 'rgba(0, 0, 255, 0.5)');
|
| +
|
| + ctx.save();
|
| + ctx.fillStyle = gradient;
|
| + ctx.shadowColor = 'rgba(255, 0, 0, 0.5)';
|
| + ctx.shadowOffsetX = 250;
|
| +
|
| + // Alpha shadow.
|
| + ctx.shadowBlur = 0;
|
| + fillShape(150, 150);
|
| +
|
| + // Blurry shadow.
|
| + ctx.shadowBlur = 10;
|
| + fillShape(150, 400);
|
| +
|
| + ctx.rotate(Math.PI/2);
|
| +
|
| + ctx.restore();
|
| + }
|
| +});
|
| +</script>
|
| +
|
| +<script>
|
| +if (window.testRunner) {
|
| + testRunner.waitUntilDone();
|
| +}
|
| +
|
| +var blob = new Blob([document.getElementById('code').textContent]);
|
| +paintWorklet.import(URL.createObjectURL(blob)).then(function() {
|
| + runAfterLayoutAndPaint(function() {
|
| + if (window.testRunner) {
|
| + testRunner.notifyDone();
|
| + }
|
| + });
|
| +});
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|