- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / gpu / feature_canvas2d.html
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>GPU Feature Testing: Canvas2D</title>
6 <script>
7 var frameCount = 0;
8 var context = null;
9
10 function init() {
11   var canvas = document.getElementById("da-canvas");
12   if (!canvas)
13     return;
14   try {
15     context = canvas.getContext("2d");
16   } catch(e) {}
17 }
18
19 function runTest() {
20   init();
21   if (context)
22     window.webkitRequestAnimationFrame(draw);
23   else
24     endTest();
25 }
26
27 function draw() {
28   frameCount++;
29   context.fillRect(0, 0, 100, frameCount);
30   if (frameCount == 6) {
31     endTest();
32   } else {
33     window.webkitRequestAnimationFrame(draw);
34   }
35 }
36
37 function endTest() {
38   domAutomationController.setAutomationId(1);
39   domAutomationController.send("FINISHED");
40 }
41 </script>
42 </head>
43 <body onload="runTest()">
44 Canvas2D should trigger GPU process launch if accelerated-2d-canvas is allowed.
45 300x300 is enough to trigger accelerated canvas 2D.
46 <canvas id="da-canvas" width="300" height="300"></canvas>
47 </body>
48 </html>