Home | History | Annotate | Download | only in ManualTests
      1 <!DOCTYPE html>
      2 <html>
      3 <body>
      4 This is a test should draw a fine filtered checkerboard pattern with no flickering. <br>
      5 This is a regression test for https://bugs.webkit.org/show_bug.cgi?id=64321. <br>
      6 <canvas id="c" width="300" height="300" style="width : 600px; height : 600px"></canvas>
      7 <script type="text/javascript">
      8 var canvas = document.getElementById('c');
      9 var ctx = canvas.getContext('2d');
     10 
     11 for (var x = 0; x < canvas.width; x++) {
     12     for (var y = 0; y < canvas.height; y++) {
     13         ctx.fillStyle = ((x + y) % 2) ? 'black' : 'white';
     14         ctx.fillRect(x, y, 1, 1);
     15     }
     16 }
     17 
     18 var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
     19 
     20 function draw() {
     21     ctx.putImageData(imageData, 0, 0);
     22     window.setTimeout(draw, 0);
     23 }
     24 
     25 draw();
     26 </script>
     27 </body>
     28 </html>
     29