Wed, 31 Dec 2014 06:55:46 +0100
Added tag TORBROWSER_REPLICA for changeset 6474c204b198
1 <!--
2 Copyright (c) 2011 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>
7 <html>
8 <head>
9 <meta charset="utf-8">
10 <title>WebGL "Texture Complete" texture conformance test.</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="40" height="40" style="width: 40px; height: 40px;"></canvas>
18 <canvas id="canvas2d" width="16" height="16" style="width: 40px; height: 40px;"></canvas>
19 <div id="description"></div>
20 <div id="console"></div>
21 <script>
22 function init()
23 {
24 if (window.initNonKhronosFramework) {
25 window.initNonKhronosFramework(false);
26 }
28 description(
29 "Checks that a texture that is not -texture-complete- does not draw if"+
30 " filtering needs mips");
32 var canvas2d = document.getElementById("canvas2d");
33 var ctx2d = canvas2d.getContext("2d");
34 ctx2d.fillStyle = "rgba(0,192,128,1)";
35 ctx2d.fillRect(0, 0, 16, 16);
37 var wtu = WebGLTestUtils;
38 var canvas = document.getElementById("example");
39 gl = wtu.create3DContext(canvas);
40 var program = wtu.setupTexturedQuad(gl);
42 gl.disable(gl.DEPTH_TEST);
43 gl.disable(gl.BLEND);
45 var tex = gl.createTexture();
46 gl.bindTexture(gl.TEXTURE_2D, tex);
47 // 16x16 texture no mips
48 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
50 var loc = gl.getUniformLocation(program, "tex");
51 gl.uniform1i(loc, 0);
53 wtu.drawQuad(gl);
54 wtu.checkCanvas(gl, [0,0,0,255],
55 "texture that is not -texture-complete- when " +
56 "TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255");
57 }
59 init();
60 successfullyParsed = true;
61 </script>
63 <script>finishTest();</script>
65 </body>
66 </html>