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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/texture-npot.html

Issue 1601093008: Remove duplicated WebGL layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/canvas/webgl/texture-npot.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/webgl/texture-npot.html b/third_party/WebKit/LayoutTests/fast/canvas/webgl/texture-npot.html
deleted file mode 100644
index 3f78e96dc108322e680522d09b084c3edb5a1fc8..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/canvas/webgl/texture-npot.html
+++ /dev/null
@@ -1,228 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>WebGL Non-Power of 2 texture conformance test.</title>
-<script src="../../../resources/js-test.js"></script>
-<script src="resources/webgl-test.js"> </script>
-<script src="resources/webgl-test-utils.js"> </script>
-</head>
-<body>
-<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
-<div id="description"></div>
-<div id="console"></div>
-<script id="vshader" type="x-shader/x-vertex">
-attribute vec4 vPosition;
-attribute vec2 texCoord0;
-varying vec2 texCoord;
-void main()
-{
- gl_Position = vPosition;
- texCoord = texCoord0;
-}
-</script>
-
-<script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision mediump float;
-#endif
-uniform samplerCube tex;
-varying vec2 texCoord;
-void main()
-{
- gl_FragColor = textureCube(tex, normalize(vec3(texCoord, 1)));
-}
-</script>
-<script>
-if (window.internals)
- window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
-
-var wtu = WebGLTestUtils;
-var canvas = document.getElementById("example");
-var gl = wtu.create3DContext(canvas);
-var program = wtu.setupTexturedQuad(gl);
-
-glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
-
-var tex = gl.createTexture();
-
-// Check that an NPOT texture not on level 0 generates INVALID_VALUE
-wtu.fillTexture(gl, tex, 5, 3, [0, 192, 128, 255], 1);
-glErrorShouldBe(gl, gl.INVALID_VALUE,
- "gl.texImage2D with NPOT texture with level > 0 should return INVALID_VALUE");
-
-// Check that an NPOT texture on level 0 succeeds
-wtu.fillTexture(gl, tex, 5, 3, [0, 192, 128, 255]);
-glErrorShouldBe(gl, gl.NO_ERROR,
- "gl.texImage2D with NPOT texture at level 0 should succeed");
-
-// Check that generateMipmap fails on NPOT
-gl.generateMipmap(gl.TEXTURE_2D);
-glErrorShouldBe(gl, gl.INVALID_OPERATION,
- "gl.generateMipmap with NPOT texture should return INVALID_OPERATION");
-
-var loc = gl.getUniformLocation(program, "tex");
-gl.uniform1i(loc, 0);
-
-// Check that nothing is drawn if filtering is not correct for NPOT
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
-
-wtu.drawQuad(gl);
-wtu.checkCanvas(
- gl, [0, 0, 0, 255],
- "NPOT texture with TEXTURE_WRAP set to REPEAT should draw with 0,0,0,255");
-glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
-
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR);
-
-wtu.drawQuad(gl);
-wtu.checkCanvas(
- gl, [0, 0, 0, 255],
- "NPOT texture with TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255");
-glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
-
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
-
-wtu.drawQuad(gl);
-wtu.checkCanvas(
- gl, [0, 192, 128, 255],
- "NPOT texture with TEXTURE_MIN_FILTER set to LINEAR should draw.");
-
-gl.copyTexImage2D(gl.TEXTURE_2D, 1, gl.RGBA, 0, 0, 5, 3, 0);
-glErrorShouldBe(gl, gl.INVALID_VALUE,
- "copyTexImage2D with NPOT texture with level > 0 should return INVALID_VALUE.");
-
-// Check that generateMipmap for an POT texture succeeds
-wtu.fillTexture(gl, tex, 4, 4, [0, 192, 128, 255]);
-gl.generateMipmap(gl.TEXTURE_2D);
-glErrorShouldBe(gl, gl.NO_ERROR,
- "gl.texImage2D and gl.generateMipmap with POT texture at level 0 should succeed");
-
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
-gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
-
-wtu.drawQuad(gl);
-wtu.checkCanvas(
- gl, [0, 192, 128, 255],
- "POT texture with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR should draw.");
-glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
-
-debug("");
-debug("check using cubemap");
-var program = wtu.setupProgram(
- gl,
- [wtu.loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER),
- wtu.loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER)],
- ['vPosition', 'texCoord0'], [0, 1]);
-var tex = gl.createTexture();
-
-// Check that an NPOT texture not on level 0 generates INVALID_VALUE
-fillCubeTexture(gl, tex, 5, 3, [0, 192, 128, 255], 1);
-glErrorShouldBe(gl, gl.INVALID_VALUE,
- "gl.texImage2D with NPOT texture with level > 0 should return INVALID_VALUE");
-
-// Check that an NPOT texture on level 0 succeeds
-fillCubeTexture(gl, tex, 5, 5, [0, 192, 128, 255]);
-glErrorShouldBe(gl, gl.NO_ERROR,
- "gl.texImage2D with NPOT texture at level 0 should succeed");
-
-// Check that generateMipmap fails on NPOT
-gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
-glErrorShouldBe(gl, gl.INVALID_OPERATION,
- "gl.generateMipmap with NPOT texture should return INVALID_OPERATION");
-
-var loc = gl.getUniformLocation(program, "tex");
-gl.uniform1i(loc, 0);
-
-// Check that nothing is drawn if filtering is not correct for NPOT
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.REPEAT);
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.REPEAT);
-
-wtu.drawQuad(gl);
-wtu.checkCanvas(
- gl, [0, 0, 0, 255],
- "NPOT cubemap with TEXTURE_WRAP set to REPEAT should draw with 0,0,0,255");
-glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
-
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR);
-
-wtu.drawQuad(gl);
-wtu.checkCanvas(
- gl, [0, 0, 0, 255],
- "NPOT cubemap with TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255");
-glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
-
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
-
-wtu.drawQuad(gl);
-wtu.checkCanvas(
- gl, [0, 192, 128, 255],
- "NPOT cubemap with TEXTURE_MIN_FILTER set to LINEAR should draw.");
-
-// Check that an POT texture on level 0 succeeds
-fillCubeTexture(gl, tex, 4, 4, [0, 192, 128, 255]);
-glErrorShouldBe(gl, gl.NO_ERROR,
- "gl.texImage2D with POT texture at level 0 should succeed");
-
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.REPEAT);
-gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.REPEAT);
-
-wtu.drawQuad(gl);
-wtu.checkCanvas(
- gl, [0, 0, 0, 255],
- "POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR but no mips draw with 0,0,0,255");
-
-// Check that generateMipmap succeeds on POT
-gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
-glErrorShouldBe(gl, gl.NO_ERROR,
- "gl.generateMipmap with POT texture should return succeed");
-
-wtu.drawQuad(gl);
-wtu.checkCanvas(
- gl, [0, 192, 128, 255],
- "POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR should draw.");
-
-function fillCubeTexture(gl, tex, width, height, color, opt_level) {
- opt_level = opt_level || 0;
- var canvas = document.createElement('canvas');
- canvas.width = width;
- canvas.height = height;
- var ctx2d = canvas.getContext('2d');
- ctx2d.fillStyle = "rgba(" + color[0] + "," + color[1] + "," + color[2] + "," + color[3] + ")";
- ctx2d.fillRect(0, 0, width, height);
- gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
- var targets = [
- gl.TEXTURE_CUBE_MAP_POSITIVE_X,
- gl.TEXTURE_CUBE_MAP_NEGATIVE_X,
- gl.TEXTURE_CUBE_MAP_POSITIVE_Y,
- gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,
- gl.TEXTURE_CUBE_MAP_POSITIVE_Z,
- gl.TEXTURE_CUBE_MAP_NEGATIVE_Z];
- for (var tt = 0; tt < targets.length; ++tt) {
- gl.texImage2D(
- targets[tt], opt_level, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);
- }
-};
-
-</script>
-</body>
-
-<script>
-</script>
-
-</body>
-</html>
-

Powered by Google App Engine
This is Rietveld 408576698