Chromium Code Reviews| Index: LayoutTests/fast/canvas/pixelated-canvas.html |
| diff --git a/LayoutTests/fast/canvas/pixelated-canvas.html b/LayoutTests/fast/canvas/pixelated-canvas.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..790183b24df49a79532ba411ba0b39ed06035f3c |
| --- /dev/null |
| +++ b/LayoutTests/fast/canvas/pixelated-canvas.html |
| @@ -0,0 +1,44 @@ |
| +<!DOCTYPE html> |
| +<style> |
| + img { |
| + display: none; |
| + } |
| + canvas { |
| + width: 1000px; |
| + height: 1000px; |
|
Justin Novosad
2014/11/18 16:32:50
Too large for layout tests.
jackhou1
2014/12/01 07:00:08
Done.
|
| + image-rendering: pixelated; |
| + } |
| + .canvas0 { |
| + position: absolute; |
| + top: 0; |
| + left: 0; |
| + z-index: 0; |
| + } |
| + .canvas1 { |
| + position: absolute; |
| + top: 250px; |
| + left: 250px; |
| + z-index: 1; |
| + } |
| +</style> |
| +<body> |
| + <img src="resources/dice_alpha.png"> |
| + <!-- Test that drawing a pixelated canvas with another pixelated canvas as source works. --> |
| + <!-- One canvas should be overlaid on the other at an offset. Both canvases should be upscaled without blurring. --> |
| + <canvas class="canvas0" width="300" height="300"></canvas> |
| + <canvas class="canvas1" width="300" height="300"></canvas> |
| +</body> |
| +<script> |
| + // Ignore the render tree. |
| + if (window.testRunner) |
| + window.testRunner.dumpAsTextWithPixelResults(); |
| + |
| + function draw() { |
| + var image = document.getElementsByTagName("img")[0]; |
| + var canvas0 = document.getElementsByTagName("canvas")[0]; |
| + var canvas1 = document.getElementsByTagName("canvas")[1]; |
| + canvas0.getContext("2d").drawImage(image, -0.5, -0.5, 300, 300); |
| + canvas1.getContext("2d").drawImage(canvas0, -0.5, -0.5, 300, 300); |
| + } |
| + window.onload = draw; |
| +</script> |