Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / resources / context-release-upon-reload-child.html
blob8d159988488ed7cf0fb605c0ecbc45adcd523e07
1 <!DOCTYPE html>
2 <html style="margin: 0; padding: 0;">
3 <head>
4 <meta charset="utf-8">
5 <title>Simple WebGL context</title>
6 <script src="webgl-test-utils.js"> </script>
7 </head>
8 <body style="margin: 0; padding: 0; overflow: hidden;">
9 <canvas id="c"
10 width="1680" height="1050"
11 style="width: 256px; height: 256px;"> <!-- scaled to fit page better -->
12 <script id="vshader" type="x-shader/x-vertex">
13 attribute vec4 vPosition;
14 void main()
16 gl_Position = vPosition;
18 </script>
20 <script id="fshader" type="x-shader/x-fragment">
21 void main()
23 gl_FragColor = vec4(1.0,0.0,0.0,1.0);
25 </script>
27 <script>
28 var wtu = WebGLTestUtils;
30 var gl = wtu.create3DContext("c", {"antialiased": false});
31 program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
33 var vertexObject = gl.createBuffer();
34 gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
35 gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.75,0, -0.75,-0.75,0, 0.75,-0.75,0 ]), gl.STATIC_DRAW);
36 gl.enableVertexAttribArray(0);
37 gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
39 gl.clearColor(0.0, 0.0, 0.0, 1.0);
40 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
41 gl.drawArrays(gl.TRIANGLES, 0, 3);
43 if(parent) {
44 window.glContext = gl;
45 parent.postMessage("Ready", "*");
47 </script>
48 </body>
49 </html>