Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: third_party/webgl/conformance-suites/1.0.0/conformance/gl-min-attribs.html

Issue 9360034: Remove everthing except conformance tests in the deps/third_party/webgl (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!--
2 Copyright (c) 2009 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
7 "http://www.w3.org/TR/html4/loose.dtd">
8 <html>
9 <head>
10 <title>WebGL the minimum number of attributes are supported.</title>
11 <link rel="stylesheet" href="../resources/js-test-style.css"/>
12 <script src="../resources/js-test-pre.js"></script>
13 <script src="resources/webgl-test.js"> </script>
14 <script src="resources/webgl-test-utils.js"> </script>
15 </head>
16 <body>
17 <canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></c anvas>
18 <div id="description"></div>
19 <div id="console"></div>
20 <script id="vshader" type="x-shader/x-vertex">
21 attribute vec4 vPosition;
22 attribute vec4 v0;
23 attribute vec4 v1;
24 attribute vec4 v2;
25 attribute vec4 v3;
26 attribute vec4 v4;
27 attribute vec4 v5;
28 attribute vec4 v6;
29 varying vec4 color;
30 void main()
31 {
32 gl_Position = vPosition;
33 color = v0 + v1 + v2 + v3 + v4 + v5 + v6;
34 }
35 </script>
36
37 <script id="fshader" type="x-shader/x-fragment">
38 #ifdef GL_ES
39 precision mediump float;
40 #endif
41 varying vec4 color;
42 void main()
43 {
44 gl_FragColor = color;
45 }
46 </script>
47 <script>
48 var wtu = WebGLTestUtils;
49 var canvas = document.getElementById("example");
50 var gl = wtu.create3DContext(canvas);
51 var program = wtu.setupTexturedQuad(gl);
52
53 var program = wtu.setupProgram(
54 gl,
55 [wtu.loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER),
56 wtu.loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER)],
57 ['vPosition', 'v0', 'v1', 'v2', 'v3', 'v4', 'v5', 'v6'],
58 [0, 1, 2, 3, 4, 5, 6, 7]);
59
60 for (var ii = 0; ii < 7; ++ii) {
61 var v = (ii + 1) / 28;
62 var vertexObject = gl.createBuffer();
63 gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
64 gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
65 v, v/2, v/4, v/8,
66 v, v/2, v/4, v/8,
67 v, v/2, v/4, v/8,
68 v, v/2, v/4, v/8,
69 v, v/2, v/4, v/8,
70 v, v/2, v/4, v/8]), gl.STATIC_DRAW);
71 gl.enableVertexAttribArray(ii + 1);
72 gl.vertexAttribPointer(ii + 1, 4, gl.FLOAT, false, 0, 0);
73 }
74
75 wtu.drawQuad(gl);
76 glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
77 wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [255, 127, 64, 32], " Should render 255,127,64,32 (+/-1)", 1);
78
79 successfullyParsed = true;
80
81 </script>
82 </body>
83 <script src="../resources/js-test-post.js"></script>
84
85 <script>
86 </script>
87
88 </body>
89 </html>
90
91
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698