summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/canvas-largedraws.html
blob: 32854698fbd61c51816595bcc3a20a195608a2f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
  <body>
    <script>
      if (window.layoutTestController)
          layoutTestController.dumpAsText();

      function newCanvasContext() {
        canvas = document.createElement("canvas");
        canvas.width = 100;
        canvas.height = 100;
        return canvas.getContext("2d");
      }

      window.onload = function () {
        ctx = newCanvasContext();
        ctx.fillStyle = '#0f0';
        ctx.fillRect(0, 0, 100, 50);
        ctx.moveTo(10500000000, 10500000000);
        ctx.lineTo(110, -10);
        ctx.lineTo(-10, 60);
        ctx.fill();
        ctx.getImageData(50, 25, 1, 1);

        ctx = newCanvasContext();
        ctx.fillStyle = '#0f0';
        ctx.scale(4500000000, 4500000000);
        ctx.moveTo(0, 0.5);
        ctx.lineTo(2, 0.5);
        ctx.stroke();
        ctx.getImageData(50, 25, 1, 1);
  
        ctx = newCanvasContext();
        ctx.fillStyle = '#0f0';
        ctx.fillRect(0, 0, 100, 50);
        ctx.scale(2, -4500000000);
        ctx.arc(25, 50, 56, 0, 2*Math.PI, false);
        ctx.fill();
        ctx.arc(105000000005, -105000000005, 105000000004, 0, 10500000000*Math.PI, false);
        ctx.fill();
        ctx.getImageData(50, 25, 1, 1);
      }
    </script>
    PASS: Draw commands with big numbers cause no problems.
  </body>
</html>