| <!DOCTYPE HTML> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <title>GPU Feature Testing: Canvas2D</title> |
| <script> |
| var frameCount = 0; |
| var context = null; |
| |
| function init() { |
| var canvas = document.getElementById("da-canvas"); |
| if (!canvas) |
| return; |
| try { |
| context = canvas.getContext("2d"); |
| } catch(e) {} |
| } |
| |
| function runTest() { |
| init(); |
| if (context) |
| window.webkitRequestAnimationFrame(draw); |
| else |
| endTest(); |
| } |
| |
| function draw() { |
| frameCount++; |
| context.fillRect(0, 0, 100, frameCount); |
| if (frameCount == 6) { |
| endTest(); |
| } else { |
| window.webkitRequestAnimationFrame(draw); |
| } |
| } |
| |
| function endTest() { |
| domAutomationController.setAutomationId(1); |
| domAutomationController.send("FINISHED"); |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| Canvas2D should trigger GPU process launch if accelerated-2d-canvas is allowed. |
| 300x300 is enough to trigger accelerated canvas 2D. |
| <canvas id="da-canvas" width="300" height="300"></canvas> |
| </body> |
| </html> |