|
1 <!DOCTYPE html> |
|
2 <html class="reftest-wait"> |
|
3 <head> |
|
4 <meta charset="UTF-8"> |
|
5 |
|
6 <script type="text/javascript" src="webgl-utils.js"></script> |
|
7 <script type="text/javascript"> |
|
8 /* Clear Test |
|
9 * |
|
10 * Clear the canvas to green to test that we get pixels to the screen. |
|
11 */ |
|
12 |
|
13 "use strict"; |
|
14 |
|
15 function renderGL(gl) { |
|
16 gl.clearColor(0.0, 1.0, 0.0, 1.0); |
|
17 gl.clear(gl.COLOR_BUFFER_BIT); |
|
18 gl.finish(); |
|
19 } |
|
20 |
|
21 function renderFailure(canvas) { |
|
22 // This will also trigger RAF for us. |
|
23 var context = canvas.getContext("2d"); |
|
24 context.fillText('WebGL failed.', 64, 64); |
|
25 } |
|
26 |
|
27 function runTest() { |
|
28 var canvas = document.getElementById("canvas"); |
|
29 var gl = initGL(canvas); |
|
30 |
|
31 if (gl) |
|
32 renderGL(gl); |
|
33 else |
|
34 renderFailure(canvas); |
|
35 |
|
36 waitForComposite(testComplete); |
|
37 } |
|
38 |
|
39 function testComplete() { |
|
40 document.documentElement.removeAttribute("class"); |
|
41 } |
|
42 |
|
43 </script> |
|
44 </head> |
|
45 |
|
46 <body onload="rAF(runTest);"> |
|
47 <canvas id="canvas" width="256" height="256"></canvas> |
|
48 </body> |
|
49 |
|
50 </html> |