12345678910111213141516171819202122232425262728 |
- <!DOCTYPE html>
- <html>
- <body>
- This is a test should draw a fine filtered checkerboard pattern with no flickering. <br>
- This is a regression test for https://bugs.webkit.org/show_bug.cgi?id=64321. <br>
- <canvas id="c" width="300" height="300" style="width : 600px; height : 600px"></canvas>
- <script type="text/javascript">
- var canvas = document.getElementById('c');
- var ctx = canvas.getContext('2d');
- for (var x = 0; x < canvas.width; x++) {
- for (var y = 0; y < canvas.height; y++) {
- ctx.fillStyle = ((x + y) % 2) ? 'black' : 'white';
- ctx.fillRect(x, y, 1, 1);
- }
- }
- var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
- function draw() {
- ctx.putImageData(imageData, 0, 0);
- window.setTimeout(draw, 0);
- }
- draw();
- </script>
- </body>
- </html>
|