Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / pixelated-off-screen-expected.html
blob963c9b472beef3ff35d8d2bd18b5c6fde85f315e
1 <!DOCTYPE html>
2 <style>
3 canvas {
4 width: 100px;
5 height: 100px;
6 image-rendering: pixelated;
8 </style>
9 <body>
10 <!-- Draw to a canvas already in the DOM. -->
11 <!-- The resulting image should be 100x100, consisting of 4 50x50 blocks of solid color, with no blurring of edges -->
12 <canvas width="2" height="2"></canvas>
13 </body>
14 <script>
15 // Ignore the render tree.
16 if (window.testRunner)
17 window.testRunner.dumpAsTextWithPixelResults();
19 var canvas = document.getElementsByTagName("canvas")[0];
20 var context = canvas.getContext("2d");
21 var imageHandle = context.createImageData(canvas.width, canvas.height);
23 var index = 0;
25 imageHandle.data[index++] = 255;
26 imageHandle.data[index++] = 0;
27 imageHandle.data[index++] = 0;
28 imageHandle.data[index++] = 255;
30 imageHandle.data[index++] = 0;
31 imageHandle.data[index++] = 255;
32 imageHandle.data[index++] = 0;
33 imageHandle.data[index++] = 255;
35 imageHandle.data[index++] = 0;
36 imageHandle.data[index++] = 0;
37 imageHandle.data[index++] = 255;
38 imageHandle.data[index++] = 255;
40 imageHandle.data[index++] = 0;
41 imageHandle.data[index++] = 0;
42 imageHandle.data[index++] = 0;
43 imageHandle.data[index++] = 255;
45 context.putImageData(imageHandle, 0, 0);
46 </script>