summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/gpu/feature_canvas2d.html
blob: eb07a6a2dd69abf70daba5a6c5c120d82e56659e (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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>GPU Feature Testing: Canvas2D</title>
<script>
function init() {
  var canvas = document.createElement("canvas");
  if (!canvas)
    return null;
  // Make sure canvas is large enough to trigger gpu acceleration.
  canvas.width = 500;
  canvas.height = 500;
  var context = null;
  try {
    context = canvas.getContext("2d");
  } catch(e) {}
  return context;
}

function runTest() {
  var c2d = init();
  if (c2d) {
    // Initialization was triggered lazily on the first draw.
    c2d.fillRect(0, 0, 1, 1);
  }
  domAutomationController.setAutomationId(1);
  domAutomationController.send("FINISHED");
}
</script>
</head>
<body onload="runTest()">
Canvas2D should trigger GPU process launch if accelerated-2d-canvas is allowed.
</body>
</html>