Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-filter.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-filter.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-filter.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..93098bb9d915480dfd2567a6db0d2a9ec06112c8 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-filter.html |
| @@ -0,0 +1,60 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<body> |
|
esprehn
2017/01/27 19:44:39
you can leave out html and body
fserb
2017/01/27 19:54:47
Done all.
|
| + |
| +<canvas id='output0' width='100' height='100'></canvas> |
| +<canvas id='output1' width='100' height='100'></canvas> |
| +<canvas id='output2' width='100' height='100'></canvas> |
| +<canvas id='output3' width='100' height='100'></canvas> |
| +<canvas id='output4' width='100' height='100'></canvas> |
| +<canvas id='output5' width='100' height='100'></canvas> |
| +<canvas id='output6' width='100' height='100'></canvas> |
| +<canvas id='output7' width='100' height='100'></canvas> |
| +<canvas id='output8' width='100' height='100'></canvas> |
| +<canvas id='output9' width='100' height='100'></canvas> |
| +<canvas id='output10' width='100' height='100'></canvas> |
| +<canvas id='output11' width='100' height='100'></canvas> |
| + |
| +<script> |
| +var patternCanvas = document.createElement('canvas'); |
| +patternCanvas.width = 30; |
| +patternCanvas.height = 30; |
| +var patternCtx = patternCanvas.getContext('2d'); |
| +patternCtx.fillStyle = '#A00'; |
| +patternCtx.fillRect(0, 0, 15, 15); |
| +patternCtx.fillStyle = '#0A0'; |
| +patternCtx.fillRect(15, 0, 15, 15); |
| +patternCtx.fillStyle = '#00A'; |
| +patternCtx.fillRect(0, 15, 15, 15); |
| +patternCtx.fillStyle = "#AA0"; |
| +patternCtx.fillRect(15, 15, 15, 15); |
| + |
| +var paint = function(id, filter) { |
| + var oc = new OffscreenCanvas(100, 100); |
| + var ctx = oc.getContext('2d'); |
| + ctx.filter = filter; |
| + ctx.drawImage(patternCanvas, 5, 5); |
| + ctx.drawImage(patternCanvas, 35, 35); |
| + ctx.drawImage(patternCanvas, 65, 65); |
| + |
| + var c = document.getElementById(id); |
| + var c = c.getContext('2d'); |
| + c.drawImage(oc, 0, 0); |
| +}; |
| + |
| +paint('output0', "none"); |
| +paint('output1', "blur(10px)"); |
| +paint('output2', "brightness(40%)"); |
| +paint('output3', "contrast(20%)"); |
| +paint('output4', "drop-shadow(0 0 5px green)"); |
| +paint('output5', "grayscale(100%)"); |
| +paint('output6', "invert(100%)"); |
| +paint('output7', "opacity(50%)"); |
| +paint('output8', "saturate(20%)"); |
| +paint('output9', "sepia(100%)"); |
| +paint('output10', "sepia(1) hue-rotate(200deg)"); |
| +paint('output11', "url(#url)"); |
| + |
| +</script> |
| +</body> |
| +</html> |