Changeset 179859 in webkit
- Timestamp:
- Feb 9, 2015, 5:02:28 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 22 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/canvas/webgl/bad-arguments-test-expected.txt (deleted)
-
LayoutTests/fast/canvas/webgl/bad-arguments-test.html (deleted)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/README.md (modified) (1 diff)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/attribs/gl-disabled-vertex-attrib.html (modified) (2 diffs)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/context/context-creation-and-destruction.html (modified) (2 diffs)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/extensions/webgl-compressed-texture-s3tc.html (modified) (1 diff)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/extensions/webgl-debug-shaders.html (modified) (2 diffs)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/extensions/webgl-depth-texture.html (modified) (2 diffs)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html (modified) (1 diff)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/misc/bad-arguments-test.html (modified) (2 diffs)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/misc/webgl-specific.html (modified) (1 diff)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/more/functions/uniformMatrixBadArgs.html (modified) (1 diff)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/more/unit.js (modified) (1 diff)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/more/util.js (modified) (1 diff)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/rendering/multisample-corruption.html (modified) (2 diffs)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/fragmentShader.frag (modified) (2 diffs)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/glsl-generator.js (modified) (1 diff)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/vertexShader.vert (modified) (2 diffs)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/webgl-test-utils.js (modified) (6 diffs)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/test-guidelines.md (modified) (6 diffs)
-
LayoutTests/webgl/1.0.2/resources/webgl_test_files/webgl-conformance-tests.html (modified) (4 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r179838 r179859 1 2015-02-09 Roger Fong <roger_fong@apple.com> 2 3 WebGL: Update 1.0.2 conformance layout tests and address new failure. 4 https://bugs.webkit.org/show_bug.cgi?id=141408. 5 <rdar://problem/19773236> 6 7 Reviewed by Dean Jackson. 8 9 * fast/canvas/webgl/bad-arguments-test-expected.txt: Removed. 10 * fast/canvas/webgl/bad-arguments-test.html: Removed. Redundant test case. 11 * webgl/1.0.2/resources/webgl_test_files/README.md: 12 * webgl/1.0.2/resources/webgl_test_files/conformance/attribs/gl-disabled-vertex-attrib.html: 13 * webgl/1.0.2/resources/webgl_test_files/conformance/context/context-creation-and-destruction.html: 14 * webgl/1.0.2/resources/webgl_test_files/conformance/extensions/webgl-compressed-texture-s3tc.html: 15 * webgl/1.0.2/resources/webgl_test_files/conformance/extensions/webgl-debug-shaders.html: 16 * webgl/1.0.2/resources/webgl_test_files/conformance/extensions/webgl-depth-texture.html: 17 * webgl/1.0.2/resources/webgl_test_files/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html: 18 * webgl/1.0.2/resources/webgl_test_files/conformance/misc/bad-arguments-test.html: 19 * webgl/1.0.2/resources/webgl_test_files/conformance/misc/webgl-specific.html: 20 * webgl/1.0.2/resources/webgl_test_files/conformance/more/functions/uniformMatrixBadArgs.html: 21 * webgl/1.0.2/resources/webgl_test_files/conformance/more/unit.js: 22 * webgl/1.0.2/resources/webgl_test_files/conformance/more/util.js: 23 (VBO.prototype.use): 24 * webgl/1.0.2/resources/webgl_test_files/conformance/rendering/multisample-corruption.html: 25 * webgl/1.0.2/resources/webgl_test_files/conformance/resources/fragmentShader.frag: 26 * webgl/1.0.2/resources/webgl_test_files/conformance/resources/glsl-generator.js: 27 * webgl/1.0.2/resources/webgl_test_files/conformance/resources/vertexShader.vert: 28 * webgl/1.0.2/resources/webgl_test_files/conformance/resources/webgl-test-utils.js: 29 (WebGLTestUtils): 30 * webgl/1.0.2/resources/webgl_test_files/test-guidelines.md: 31 * webgl/1.0.2/resources/webgl_test_files/webgl-conformance-tests.html: 32 1 33 2015-02-09 Jer Noble <jer.noble@apple.com> 2 34 -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/README.md
r157888 r179859 44 44 45 45 minVersion: Set to the minimum version of each test to include. Only tests 46 at this version or above will be in lcuded.46 at this version or above will be included. 47 47 48 48 Example: webgl-conformance-tests.html?minVersion=1.3.2 -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/attribs/gl-disabled-vertex-attrib.html
r157888 r179859 45 45 attribute vec4 a_color; 46 46 varying vec4 v_color; 47 bool isCorrectColor(vec4 v) { 48 return v.x == 0.0 && v.y == 0.0 && v.z == 0.0 && v.w == 1.0; 49 } 47 50 void main() { 48 51 gl_Position = a_position; 49 v_color = a_color;52 v_color = isCorrectColor(a_color) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); 50 53 } 51 54 </script> … … 54 57 precision mediump float; 55 58 varying vec4 v_color; 56 bool isCorrectColor(vec4 v) {57 return v.x == 0.0 && v.y == 0.0 && v.z == 0.0 && v.w == 1.0;58 }59 59 void main() { 60 gl_FragColor = isCorrectColor(v_color) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);60 gl_FragColor = v_color; 61 61 } 62 62 </script> -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/context/context-creation-and-destruction.html
r157888 r179859 33 33 <link rel="stylesheet" href="../../resources/js-test-style.css"/> 34 34 <script src="../../resources/js-test-pre.js"></script> 35 <script src="../resources/webgl-test.js"> </script>36 35 <script src="../resources/webgl-test-utils.js"> </script> 36 <script src="../resources/iterable-test.js"> </script> 37 37 </head> 38 38 <body> … … 41 41 <script> 42 42 "use strict"; 43 description(); 44 43 45 var wtu = WebGLTestUtils; 44 var target = 500;45 var count = 0;46 46 47 description(); 48 doNextTest(); 49 50 // Creates a canvas and a texture then exits. There are 51 // no references to either so both should be garbage collected. 52 function test() { 53 var canvas = document.createElement("canvas"); 54 // This is safe for any device. See drawingBufferWidth in spec. 55 canvas.width = 2048; 56 canvas.height = 2048; 57 var gl = wtu.create3DContext(canvas); 58 var maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); 59 var size = Math.min(1024, maxTextureSize); 60 var tex = gl.createTexture(); 61 gl.bindTexture(gl.TEXTURE_2D, tex); 62 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE, 63 new Uint8Array(size * size * 4)); 64 gl.clear(gl.COLOR_BUFFER_BIT); 65 glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors"); 66 } 67 68 function doNextTest() { 69 ++count; 70 debug("test " + count + " of " + target); 71 test(); 72 if (count < target) { 73 setTimeout(doNextTest, 100); 74 } else { 75 finishTest(); 76 } 77 } 47 var test = IterableTest.createContextCreationAndDestructionTest(); 48 var iterations = parseInt(wtu.getUrlOptions().iterations, 10) || 50; 49 IterableTest.run(test, iterations); 78 50 79 51 var successfullyParsed = true; -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/extensions/webgl-compressed-texture-s3tc.html
r157888 r179859 610 610 failed = true; 611 611 var was = actual[actualOffset + 0].toString(); 612 for ( j = 1; j < 4; ++j) {612 for (var j = 1; j < 4; ++j) { 613 613 was += "," + actual[actualOffset + j]; 614 614 } -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/extensions/webgl-debug-shaders.html
r157888 r179859 56 56 var info = null; 57 57 var translatedSource; 58 var newTranslatedSource; 58 59 59 60 if (!gl) { … … 118 119 // if no source has been defined or compileShader() has not been called, 119 120 // getTranslatedShaderSource() should return an empty string. 120 shouldBe Null("ext.getTranslatedShaderSource(shader)");121 shouldBe("ext.getTranslatedShaderSource(shader)", '""'); 121 122 gl.shaderSource(shader, info.source); 122 shouldBe Null("ext.getTranslatedShaderSource(shader)");123 shouldBe("ext.getTranslatedShaderSource(shader)", '""'); 123 124 gl.compileShader(shader); 124 125 shouldBeTrue("gl.getShaderParameter(shader, gl.COMPILE_STATUS)"); -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/extensions/webgl-depth-texture.html
r157888 r179859 274 274 dumpIt(gl, res, "--depth--"); 275 275 276 // Check that each pixel's RGB are the same and that it's value is less 277 // than the previous pixel in either direction. Basically verify we have a 278 // gradient. 276 // Check that each pixel's R value is less than that of the previous pixel 277 // in either direction. Basically verify we have a gradient. 279 278 var success = true; 280 279 for (var yy = 0; yy < res; ++yy) { … … 283 282 var left = actual - 4; 284 283 var down = actual - res * 4; 285 286 if (actualPixels[actual + 0] != actualPixels[actual + 1]) {287 testFailed('R != G');288 success = false;289 }290 if (actualPixels[actual + 0] != actualPixels[actual + 2]) {291 testFailed('R != B');292 success = false;293 }294 // ALPHA is implementation dependent295 if (actualPixels[actual + 3] != 0xFF && actualPixels[actual + 3] != actualPixels[actual + 0]) {296 testFailed('A != 255 && A != R');297 success = false;298 }299 284 300 285 if (xx > 0) { -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html
r161247 r179859 110 110 var program = wtu.setupProgram(gl, ["vshader", "fshader-with-one-element-arrays"], ["a_position"]); 111 111 var green_loc = gl.getUniformLocation(program, "u_colors[0].color[0]"); 112 var zeroth_color = gl.getUniformLocation(program, "u_colors[0].color");113 shouldBeTrue("zeroth_color != undefined");114 112 gl.uniform4fv(green_loc, [0, 1, 0, 1]); 115 113 wtu.clearAndDrawUnitQuad(gl); -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/misc/bad-arguments-test.html
r157888 r179859 73 73 74 74 for (var i = 0; i < testArguments.length; ++i) { 75 var func, func2 , func3;75 var func, func2; 76 76 if (testArguments[i].throws) { 77 77 func = shouldThrow; 78 78 func2 = shouldThrow; 79 func3 = shouldThrow;80 79 } else { 81 80 func = shouldBeUndefined; 82 81 func2 = shouldBeNull; 83 func3 = shouldBeEmptyString;84 82 } 85 83 argument = testArguments[i].value; … … 103 101 func("context.uniformMatrix2fv(argument, false, new Float32Array([0.0, 0.0, 0.0, 0.0]))"); 104 102 103 func2("context.getProgramInfoLog(argument)"); 105 104 func2("context.getProgramParameter(argument, 0)"); 105 func2("context.getShaderInfoLog(argument)"); 106 106 func2("context.getShaderParameter(argument, 0)"); 107 func2("context.getShaderSource(argument)"); 107 108 func2("context.getUniform(argument, loc)"); 108 109 func2("context.getUniform(program, argument)"); 109 110 func2("context.getUniformLocation(argument, 'u_modelViewProjMatrix')"); 110 111 111 func3("context.getProgramInfoLog(argument)");112 func3("context.getShaderInfoLog(argument)");113 func3("context.getShaderSource(argument)");114 112 } 115 113 -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/misc/webgl-specific.html
r179482 r179859 97 97 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.drawArrays(gl.TRIANGLES, 0, 0)"); 98 98 99 // Added in 1.0.3 version of spec. 100 // debug(""); 101 // debug("Verify that IMPLEMENTATION_COLOR_READ_FORMAT and IMPLEMENTATION_COLOR_READ_TYPE are undefined"); 102 // shouldBeUndefined(gl.IMPLEMENTATION_COLOR_READ_FORMAT); 103 // shouldBeUndefined(gl.IMPLEMENTATION_COLOR_READ_TYPE); 104 99 105 debug(""); 100 106 debug("Verify that *LENGTH are undefined"); -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/more/functions/uniformMatrixBadArgs.html
r157888 r179859 121 121 var d = new Uint8Array(4); 122 122 gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, d); 123 assertArrayEquals ([1,2,3,8], d);123 assertArrayEqualsWithEpsilon([1,2,3,8], d, [1,1,1,1]); 124 124 sh.destroy(); 125 125 } -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/more/unit.js
r157888 r179859 389 389 testPassed("assertArrayEquals", name, v, p); 390 390 return true; 391 } 392 393 function assertArrayEqualsWithEpsilon(name, v, p, l) { 394 if (l == null) { l = p; p = v; v = name; name = null; } 395 if (!v) { 396 testFailed("assertArrayEqualsWithEpsilon: first array undefined", name, v, p); 397 return false; 398 } 399 if (!p) { 400 testFailed("assertArrayEqualsWithEpsilon: second array undefined", name, v, p); 401 return false; 402 } 403 if (!l) { 404 testFailed("assertArrayEqualsWithEpsilon: limit array undefined", name, v, p); 405 return false; 406 } 407 if (v.length != p.length) { 408 testFailed("assertArrayEqualsWithEpsilon", name, v, p, l); 409 return false; 410 } 411 if (v.length != l.length) { 412 testFailed("assertArrayEqualsWithEpsilon", name, v, p, l); 413 return false; 414 } 415 for (var ii = 0; ii < v.length; ++ii) { 416 if (Math.abs(v[ii]- p[ii])>l[ii]) { 417 testFailed("assertArrayEqualsWithEpsilon", name, v, p, l); 418 return false; 419 } 420 } 421 testPassed("assertArrayEqualsWithEpsilon", name, v, p, l); 422 return true; 391 423 } 392 424 -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/more/util.js
r157888 r179859 842 842 var gl = this.gl; 843 843 for (var i=0; i<arguments.length; i++) { 844 if (arguments[i] == null) continue;844 if (arguments[i] == null || arguments[i] == -1) continue; 845 845 gl.bindBuffer(gl.ARRAY_BUFFER, this.vbos[i]); 846 846 gl.vertexAttribPointer(arguments[i], this.data[i].size, gl.FLOAT, false, 0, 0); -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/rendering/multisample-corruption.html
r157888 r179859 33 33 <link rel="stylesheet" href="../../resources/js-test-style.css"/> 34 34 <script src="../../resources/js-test-pre.js"></script> 35 <script src="../resources/webgl-test.js"> </script>36 35 <script src="../resources/webgl-test-utils.js"> </script> 36 <script src="../resources/iterable-test.js"> </script> 37 37 </head> 38 38 <body> … … 40 40 <div id="description"></div> 41 41 <div id="console"></div> 42 <script id="vshader" type="x-shader/x-vertex">43 attribute vec4 vPosition;44 void main()45 {46 gl_Position = vPosition;47 }48 </script>49 50 <script id="fshader" type="x-shader/x-fragment">51 void main()52 {53 gl_FragColor = vec4(0.0,0.0,0.0,0.0);54 }55 </script>56 57 42 <script> 58 43 "use strict"; 59 function init()60 {61 description(document.title);62 44 63 var lastContext = null; 64 var cycleCount = 0; 65 var maxCycles = 100; 66 var failed = false; 67 var wtu = WebGLTestUtils; 68 var gl = wtu.create3DContext("example", {antialias: true, preserveDrawingBuffer: true}); 45 description(document.title); 69 46 70 gl.clearColor(1.0, 0.0, 0.0, 1.0); 71 gl.clear(gl.COLOR_BUFFER_BIT); 47 var wtu = WebGLTestUtils; 72 48 73 var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]); 74 var vertexObject = gl.createBuffer(); 75 gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject); 76 gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,2.5,0, 1.5,1.5,0, 2.5,1.5,0 ]), gl.STATIC_DRAW); 77 gl.enableVertexAttribArray(0); 78 gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0); 49 var gl = wtu.create3DContext("example", {antialias: true, preserveDrawingBuffer: true}); 50 var test = IterableTest.createMultisampleCorruptionTest(gl); 51 var iterations = parseInt(wtu.getUrlOptions().iterations, 10) || 25; 52 IterableTest.run(test, iterations); 79 53 80 function cycleAndTest() { 81 var gl2 = wtu.create3DContext(null, {antialias: true}); 82 83 gl2.canvas.width = gl2.canvas.height = 1024; 84 gl2.canvas.style.width = gl2.canvas.style.height = "1px"; 85 document.body.appendChild(gl2.canvas); 86 87 gl2.clearColor(1.0, 0.0, 0.0, 1.0); 88 gl2.clear(gl2.COLOR_BUFFER_BIT); 89 90 if(lastContext) { 91 gl.drawArrays(gl.TRIANGLES, 0, 3); 92 var msg = "Should be red after loop " + cycleCount; 93 wtu.checkCanvasRectColor(gl, 94 0, 0, gl.canvas.width, gl.canvas.height, 95 [255, 0, 0, 255], null, 96 function() { 97 testPassed(msg); 98 }, 99 function() { 100 testFailed(msg); 101 failed = true; 102 }, 103 debug); 104 document.body.removeChild(lastContext.canvas); 105 } 106 107 lastContext = gl2; 108 cycleCount++; 109 110 if(cycleCount <= maxCycles && !failed) { 111 wtu.waitForComposite(gl2, cycleAndTest); 112 } else { 113 finishTest(); 114 } 115 } 116 117 cycleAndTest(); 118 } 119 120 init(); 121 var successfullyParsed = true; 54 var successfullyParsed = true; 122 55 </script> 123 56 -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/fragmentShader.frag
r165676 r179859 1 1 /* 2 Copyright (C) 2009 Apple Inc. All rights reserved.2 Copyright (C) 2009 Apple Computer, Inc. All rights reserved. 3 3 4 4 Redistribution and use in source and binary forms, with or without … … 11 11 documentation and/or other materials provided with the distribution. 12 12 13 THIS SOFTWARE IS PROVIDED BY APPLE INC. AS IS AND ANY13 THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. AS IS AND ANY 14 14 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 15 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR16 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 17 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 18 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/glsl-generator.js
r157888 r179859 253 253 var gridRes = params.gridRes; 254 254 var vertexTolerance = params.tolerance || 0; 255 var fragmentTolerance = vertexTolerance;255 var fragmentTolerance = params.tolerance || 1; 256 256 if ('fragmentTolerance' in params) 257 fragmentTolerance = params.fragmentTolerance || 0;257 fragmentTolerance = params.fragmentTolerance; 258 258 259 259 description("Testing GLSL feature: " + params.feature); -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/vertexShader.vert
r165676 r179859 1 1 /* 2 Copyright (C) 2009 Apple Inc. All rights reserved.2 Copyright (C) 2009 Apple Computer, Inc. All rights reserved. 3 3 4 4 Redistribution and use in source and binary forms, with or without … … 11 11 documentation and/or other materials provided with the distribution. 12 12 13 THIS SOFTWARE IS PROVIDED BY APPLE INC. AS IS AND ANY13 THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. AS IS AND ANY 14 14 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 15 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR16 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 17 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 18 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/resources/webgl-test-utils.js
r161383 r179859 29 29 */ 30 30 var log = function(msg) { 31 if (window.console && window.console.log) { 32 window.console.log(msg); 33 } 31 34 }; 32 35 … … 36 39 */ 37 40 var error = function(msg) { 41 if (window.console) { 42 if (window.console.error) { 43 window.console.error(msg); 44 } 45 else if (window.console.log) { 46 window.console.log(msg); 47 } 48 } 38 49 }; 39 50 … … 840 851 * is different than color 841 852 * @param {!function()} logFn Function to call for logging. 842 */ 843 var checkCanvasRectColor = function(gl, x, y, width, height, color, opt_errorRange, sameFn, differentFn, logFn) { 853 * @param {Uint8Array} opt_readBackBuf typically passed to reuse existing 854 * buffer while reading back pixels. 855 */ 856 var checkCanvasRectColor = function(gl, x, y, width, height, color, opt_errorRange, sameFn, differentFn, logFn, opt_readBackBuf) { 844 857 var errorRange = opt_errorRange || 0; 845 858 if (!errorRange.length) { … … 848 861 var buf; 849 862 if (gl instanceof WebGLRenderingContext) { 850 buf = new Uint8Array(width * height * 4);863 buf = opt_readBackBuf ? opt_readBackBuf : new Uint8Array(width * height * 4); 851 864 gl.readPixels(x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf); 852 865 } else { … … 967 980 } 968 981 } 982 }; 983 984 /** 985 * Returns a map of URL querystring options 986 * @return {Object?} Object containing all the values in the URL querystring 987 */ 988 var getUrlOptions = function() { 989 var options = {}; 990 var s = window.location.href; 991 var q = s.indexOf("?"); 992 var e = s.indexOf("#"); 993 if (e < 0) { 994 e = s.length; 995 } 996 var query = s.substring(q + 1, e); 997 var pairs = query.split("&"); 998 for (var ii = 0; ii < pairs.length; ++ii) { 999 var keyValue = pairs[ii].split("="); 1000 var key = keyValue[0]; 1001 var value = decodeURIComponent(keyValue[1]); 1002 options[key] = value; 1003 } 1004 1005 return options; 969 1006 }; 970 1007 … … 1989 2026 getSupportedExtensionWithKnownPrefixes: getSupportedExtensionWithKnownPrefixes, 1990 2027 getUrlArguments: getUrlArguments, 2028 getUrlOptions: getUrlOptions, 1991 2029 getAttribMap: getAttribMap, 1992 2030 getUniformMap: getUniformMap, -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/test-guidelines.md
r157888 r179859 2 2 =============================================== 3 3 4 Thank you for cont ibuting to the WebGL conformance tests.4 Thank you for contributing to the WebGL conformance tests. 5 5 Please try to follow these guidelines when submitting a test. 6 6 … … 44 44 45 45 Ideally, copy an existing test and modify it for your new test. Try not to duplicate 46 code that already exists where appro riate. In particular46 code that already exists where appropriate. In particular 47 47 48 48 * use the functions in WebGLTestUtils rather than duplicating functionality. … … 92 92 93 93 * If you need to wait for a composite call `WebGLTestUtils.waitForComposite`. 94 As compositing is a browser spec fic thing this provides a central place to94 As compositing is a browser specific thing this provides a central place to 95 95 update all tests that rely on compositing to function. 96 96 … … 134 134 135 135 Remember the tests need to run without timing out even and slow mobile devices. 136 The harness resets the timeout timer every time a test reports success or failure136 The harness resets the timeout timer every time a test reports success or failure 137 137 so as long as some part of your test calls `testPassed` or `testFailed` or one of the 138 138 many wrappers (`shouldXXX`, `glErrorShouldBe`, `WebGLTestUtils.checkCanvasXXX`, etc..) 139 139 every so often the harness will not timeout your test. 140 140 141 * The test harness requ ries the global variable `successfullyParse` to be set to true.141 * The test harness requires the global variable `successfullyParse` to be set to true. 142 142 This usually appears at the end of a file. 143 143 144 144 var successfullyParsed = true; 145 145 146 * Do not use browser spec fic code.146 * Do not use browser specific code. 147 147 148 148 * Do not check the browser version. Use feature detection. … … 152 152 to one place. 153 153 154 * Vendors may place test harness specific code in the testing infr ustructure.154 * Vendors may place test harness specific code in the testing infrastructure. 155 155 156 156 resources/js-test-pre.js … … 165 165 * All JavaScript must start with "use strict"; 166 166 167 * If adding a new test edit the appro riate 00_test_list.txt file167 * If adding a new test edit the appropriate 00_test_list.txt file 168 168 169 169 Each folder has a 00_test_list.txt file that lists the test in that folder. 170 170 Each new test should be prefixed with the option `--min-version <version>` where 171 version is 1 more than the newest official ver ison. At the time of this writing171 version is 1 more than the newest official version. At the time of this writing 172 172 all new tests should be prefixed with `--min-version 1.0.2` 173 173 -
trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/webgl-conformance-tests.html
r157888 r179859 145 145 var pageCount = 0; 146 146 var folderCount = 0; 147 var autoScroll = true; 147 var autoScrollEnabled = true; // Whether the user prefers to auto scroll 148 var autoScroll = true; // Whether auto scroll is actually performed 148 149 149 150 var Page = function(reporter, folder, testIndex, url) { … … 298 299 button.value = 'run'; 299 300 button.onclick = function() { 300 autoScroll = true;301 autoScroll = autoScrollEnabled; 301 302 that.run(); 302 303 }; … … 772 773 button.disabled = true; 773 774 button.onclick = function() { 774 autoScroll = true;775 autoScroll = autoScrollEnabled; 775 776 reporter.postTestStartToServer(); 776 777 testHarness.runTests(); 778 }; 779 var autoScrollCheckbox = document.getElementById("autoScrollCheckbox"); 780 autoScrollCheckbox.checked = autoScrollEnabled; 781 autoScrollCheckbox.onclick = function() { 782 autoScrollEnabled = autoScrollCheckbox.checked; 783 autoScroll = autoScrollEnabled; 777 784 }; 778 785 var textbutton = document.getElementById("showTextSummary"); … … 830 837 <br/> 831 838 <input type="button" value="run tests" id="runTestsButton"/> 839 <br/> 840 <input type="checkbox" id="autoScrollCheckbox"/> 841 <label for="autoScrollCheckbox">auto scroll</label> 832 842 <br/> 833 843 <input type="button" style="visibility: hidden;" value="display text summary" id="showTextSummary"/> -
trunk/Source/WebCore/ChangeLog
r179850 r179859 1 2015-02-09 Roger Fong <roger_fong@apple.com> 2 3 WebGL: Update 1.0.2 conformance layout tests and address new failure. 4 https://bugs.webkit.org/show_bug.cgi?id=141408. 5 <rdar://problem/19773236> 6 7 Reviewed by Dean Jackson. 8 9 Tests covered by updated 1.0.2 conformance tests. 10 11 * html/canvas/WebGLRenderingContextBase.cpp: 12 Return null string instead of empty string if parameter validation fails. 13 (WebCore::WebGLRenderingContextBase::getProgramInfoLog): 14 (WebCore::WebGLRenderingContextBase::getShaderInfoLog): 15 (WebCore::WebGLRenderingContextBase::getShaderSource): 16 1 17 2015-02-09 Timothy Horton <timothy_horton@apple.com> 2 18 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
r179842 r179859 2618 2618 { 2619 2619 UNUSED_PARAM(ec); 2620 if (isContextLostOrPending() )2620 if (isContextLostOrPending() || !validateWebGLObject("getProgramInfoLog", program)) 2621 2621 return String(); 2622 if (!validateWebGLObject("getProgramInfoLog", program))2623 return "";2624 2622 return ensureNotNull(m_context->getProgramInfoLog(objectOrZero(program))); 2625 2623 } … … 2715 2713 { 2716 2714 UNUSED_PARAM(ec); 2717 if (isContextLostOrPending() )2715 if (isContextLostOrPending() || !validateWebGLObject("getShaderInfoLog", shader)) 2718 2716 return String(); 2719 if (!validateWebGLObject("getShaderInfoLog", shader))2720 return "";2721 2717 return ensureNotNull(m_context->getShaderInfoLog(objectOrZero(shader))); 2722 2718 } … … 2757 2753 { 2758 2754 UNUSED_PARAM(ec); 2759 if (isContextLostOrPending() )2755 if (isContextLostOrPending() || !validateWebGLObject("getShaderSource", shader)) 2760 2756 return String(); 2761 if (!validateWebGLObject("getShaderSource", shader))2762 return "";2763 2757 return ensureNotNull(shader->getSource()); 2764 2758 }
Note:
See TracChangeset
for help on using the changeset viewer.