Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / compositing / webgl / webgl-no-alpha.html
blob1df59c28e56aa51f775bb3ca6511d37452a64ea3
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style type="text/css" media="screen">
5 body {
6 outline: 10px solid transparent; /* affects layer sizes */
8 canvas {
9 margin: 20px;
10 width: 200px;
11 height: 200px;
12 padding: 0 20px;
15 .compare {
16 margin-left: 40px;
17 margin-top: 20px;
18 width: 200px;
19 height: 200px;
20 background-color: rgba(0, 255, 0, 1.0);
22 </style>
23 <script>
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});
33 if (!gl) {
34 alert("No WebGL context found");
35 return null;
38 gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
39 gl.clearDepth(clearDepth);
41 return gl;
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);
51 function init()
53 drawCanvas('canvas');
55 </script>
56 </head>
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. -->
63 </body>
64 </html>