OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <style> | |
3 img { | |
4 display: none; | |
5 } | |
6 canvas { | |
7 width: 1000px; | |
8 height: 1000px; | |
Justin Novosad
2014/11/18 16:32:50
Too large for layout tests.
jackhou1
2014/12/01 07:00:08
Done.
| |
9 image-rendering: pixelated; | |
10 } | |
11 .canvas0 { | |
12 position: absolute; | |
13 top: 0; | |
14 left: 0; | |
15 z-index: 0; | |
16 } | |
17 .canvas1 { | |
18 position: absolute; | |
19 top: 250px; | |
20 left: 250px; | |
21 z-index: 1; | |
22 } | |
23 </style> | |
24 <body> | |
25 <img src="resources/dice_alpha.png"> | |
26 <!-- Test that drawing a pixelated canvas with another pixelated canvas as s ource works. --> | |
27 <!-- One canvas should be overlaid on the other at an offset. Both canvases should be upscaled without blurring. --> | |
28 <canvas class="canvas0" width="300" height="300"></canvas> | |
29 <canvas class="canvas1" width="300" height="300"></canvas> | |
30 </body> | |
31 <script> | |
32 // Ignore the render tree. | |
33 if (window.testRunner) | |
34 window.testRunner.dumpAsTextWithPixelResults(); | |
35 | |
36 function draw() { | |
37 var image = document.getElementsByTagName("img")[0]; | |
38 var canvas0 = document.getElementsByTagName("canvas")[0]; | |
39 var canvas1 = document.getElementsByTagName("canvas")[1]; | |
40 canvas0.getContext("2d").drawImage(image, -0.5, -0.5, 300, 300); | |
41 canvas1.getContext("2d").drawImage(canvas0, -0.5, -0.5, 300, 300); | |
42 } | |
43 window.onload = draw; | |
44 </script> | |
OLD | NEW |