4 <style type=
"text/css" media=
"screen">
6 outline:
10px solid transparent; /* affects layer sizes */
20 background-color: rgba(
0,
255,
0,
1.0);
24 if (window
.testRunner
) {
25 testRunner
.overridePreference("WebKitWebGLEnabled", "1");
26 testRunner
.dumpAsTextWithPixelResults();
29 function initWebGL(canvasName
, vshader
, fshader
, attribs
, clearColor
, clearDepth
)
31 var canvas
= document
.getElementById(canvasName
);
32 var gl
= canvas
.getContext("webgl", {alpha
: false});
34 alert("No WebGL context found");
38 gl
.clearColor(clearColor
[0], clearColor
[1], clearColor
[2], clearColor
[3]);
39 gl
.clearDepth(clearDepth
);
44 function drawCanvas(canvasID
)
46 var gl
= initWebGL(canvasID
, "", "", [], [ 0, 1, 0, 0 ], 1);
47 gl
.viewport(0, 0, 200, 200);
48 gl
.clear(gl
.COLOR_BUFFER_BIT
| gl
.DEPTH_BUFFER_BIT
);
57 <body onload=
"init()">
59 <div class=
"compare"></div>
60 <canvas id=
"canvas" width=
"200" height=
"200"></canvas>
62 <!-- Top and bottom should look the same. -->