content/canvas/test/webgl-conformance/extra/webgl-info.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!--
michael@0 2 Copyright (c) 2009 The Chromium Authors. All rights reserved.
michael@0 3 Use of this source code is governed by a BSD-style license that can be
michael@0 4 found in the LICENSE file.
michael@0 5 -->
michael@0 6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
michael@0 7 "http://www.w3.org/TR/html4/loose.dtd">
michael@0 8 <html>
michael@0 9 <head>
michael@0 10 <meta charset="utf-8">
michael@0 11 <title>WebGL Information</title>
michael@0 12 <script src="../../demos/common/webgl-utils.js"> </script>
michael@0 13 <script>
michael@0 14 window.onload = main;
michael@0 15
michael@0 16 function createCell(txt) {
michael@0 17 var str = txt.toString();
michael@0 18 if (typeof txt != 'string') {
michael@0 19 if (txt.length !== undefined) {
michael@0 20 str = "";
michael@0 21 for (var ii = 0; ii < txt.length; ++ii) {
michael@0 22 str += (ii == 0 ? "" : ", ") + txt[ii];
michael@0 23 }
michael@0 24 }
michael@0 25 }
michael@0 26 var t = document.createTextNode(str);
michael@0 27 var d = document.createElement("div");
michael@0 28 var td = document.createElement("td");
michael@0 29 d.appendChild(t);
michael@0 30 td.appendChild(d);
michael@0 31 return td;
michael@0 32 }
michael@0 33
michael@0 34 function main() {
michael@0 35 var canvas = document.getElementById("example");
michael@0 36 var gl = WebGLUtils.setupWebGL(canvas);
michael@0 37 if (!gl) {
michael@0 38 return;
michael@0 39 }
michael@0 40
michael@0 41 var pnames = [
michael@0 42 'VERSION',
michael@0 43 'VENDOR',
michael@0 44 'RENDERER',
michael@0 45 'MAX_COMBINED_TEXTURE_IMAGE_UNITS',
michael@0 46 'MAX_CUBE_MAP_TEXTURE_SIZE',
michael@0 47 'MAX_FRAGMENT_UNIFORM_VECTORS',
michael@0 48 'MAX_RENDERBUFFER_SIZE',
michael@0 49 'MAX_TEXTURE_IMAGE_UNITS',
michael@0 50 'MAX_TEXTURE_SIZE',
michael@0 51 'MAX_VARYING_VECTORS',
michael@0 52 'MAX_VERTEX_ATTRIBS',
michael@0 53 'MAX_VERTEX_TEXTURE_IMAGE_UNITS',
michael@0 54 'MAX_VERTEX_UNIFORM_VECTORS',
michael@0 55 'MAX_VIEWPORT_DIMS'
michael@0 56 ];
michael@0 57 var table = document.createElement("table");
michael@0 58 var tb = document.createElement("tbody");
michael@0 59 for (var ii = 0; ii < pnames.length; ++ii) {
michael@0 60 var pname = pnames[ii];
michael@0 61 var value = gl.getParameter(gl[pname]);
michael@0 62 var tr = document.createElement("tr");
michael@0 63 var td1 = createCell(pname);
michael@0 64 var td2 = createCell(value);
michael@0 65 tr.appendChild(td1);
michael@0 66 tr.appendChild(td2);
michael@0 67 tb.appendChild(tr);
michael@0 68 }
michael@0 69 table.appendChild(tb);
michael@0 70 document.getElementById("info").appendChild(table);
michael@0 71 }
michael@0 72 </script>
michael@0 73 </head>
michael@0 74 <body>
michael@0 75 <h1>WebGL Info</h1>
michael@0 76 <div id="info"></div>
michael@0 77 <canvas id="example" width="256" height="16" style="width: 256px; height: 48px;"></canvas>
michael@0 78 </body>
michael@0 79 </html>
michael@0 80

mercurial