Changeset 75570 in webkit
- Timestamp:
- Jan 11, 2011 4:39:20 PM (13 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 added
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r75569 r75570 1 2011-01-11 Adrienne Walker <enne@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 Sync WebGL texImage2D video test from Khronos and re-enable it. 6 https://bugs.webkit.org/show_bug.cgi?id=44459 7 8 * fast/canvas/webgl/resources/quadrants.mp4: Removed. 9 * fast/canvas/webgl/resources/quadrants.ogv: Removed. 10 * fast/canvas/webgl/resources/red-green.mp4: Added. 11 * fast/canvas/webgl/resources/red-green.theora.ogv: Added. 12 * fast/canvas/webgl/resources/red-green.webmvp8.webm: Added. 13 * fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-expected.txt: 14 * fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html: 15 * platform/chromium-gpu/test_expectations.txt: 16 * platform/chromium/test_expectations.txt: 17 * platform/mac-snowleopard/Skipped: 18 1 19 2011-01-11 Mihai Parparita <mihaip@chromium.org> 2 20 -
trunk/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-expected.txt
r65756 r75570 1 2 Verify texImage2D and texSubImage2D code paths taking Videos 1 Verify texImage2D and texSubImage2D code paths taking Video Elements 3 2 4 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 5 4 5 Testing texImage2D with flipY=true 6 Checking lower left corner 7 PASS shouldBe 0,255,0 8 Checking upper left corner 9 PASS shouldBe 255,0,0 6 10 Testing texImage2D with flipY=false 7 PASS pixelAt(0, 0) is red 8 PASS pixelAt(bufWidth-1, 0) is green 9 PASS pixelAt(0, bufHeight-1) is yellow 10 PASS pixelAt(bufWidth-1, bufHeight-1) is blue 11 Testing texImage2D with flipY=true 12 PASS pixelAt(0, 0) is yellow 13 PASS pixelAt(bufWidth-1, 0) is blue 14 PASS pixelAt(0, bufHeight-1) is red 15 PASS pixelAt(bufWidth-1, bufHeight-1) is green 16 Testing TexSubImage2D with flipY=false, scale=2, ox=0, oy=0 17 PASS pixelAt(0, 0) is red 18 PASS pixelAt(bufWidth-1, 0) is black 19 PASS pixelAt(0, bufHeight-1) is black 20 PASS pixelAt(bufWidth-1, bufHeight-1) is black 21 Testing TexSubImage2D with flipY=true, scale=2, ox=0, oy=0 22 PASS pixelAt(0, 0) is yellow 23 PASS pixelAt(bufWidth-1, 0) is black 24 PASS pixelAt(0, bufHeight-1) is black 25 PASS pixelAt(bufWidth-1, bufHeight-1) is black 26 Testing TexSubImage2D with flipY=false, scale=2, ox=0.5, oy=0.5 27 PASS pixelAt(0, 0) is black 28 PASS pixelAt(bufWidth-1, 0) is black 29 PASS pixelAt(0, bufHeight-1) is black 30 PASS pixelAt(bufWidth-1, bufHeight-1) is blue 31 Testing TexSubImage2D with flipY=true, scale=2, ox=0.5, oy=0.5 32 PASS pixelAt(0, 0) is black 33 PASS pixelAt(bufWidth-1, 0) is black 34 PASS pixelAt(0, bufHeight-1) is black 35 PASS pixelAt(bufWidth-1, bufHeight-1) is green 11 Checking lower left corner 12 PASS shouldBe 255,0,0 13 Checking upper left corner 14 PASS shouldBe 0,255,0 15 Testing texSubImage2D with flipY=true 16 Checking lower left corner 17 PASS shouldBe 0,255,0 18 Checking upper left corner 19 PASS shouldBe 255,0,0 20 Testing texSubImage2D with flipY=false 21 Checking lower left corner 22 PASS shouldBe 255,0,0 23 Checking upper left corner 24 PASS shouldBe 0,255,0 36 25 PASS successfullyParsed is true 37 26 38 27 TEST COMPLETE 39 28 -
trunk/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html
r65756 r75570 5 5 <script src="resources/webgl-test.js"></script> 6 6 <script src="resources/webgl-test-utils.js"></script> 7 <script src="../../../media/media-file.js"></script>8 7 <script> 9 8 var wtu = WebGLTestUtils; … … 12 11 var successfullyParsed = false; 13 12 13 if (window.initNonKhronosFramework) { 14 window.initNonKhronosFramework(true); 15 } 16 14 17 function init() 15 18 { 16 if (window.initNonKhronosFramework) { 17 window.initNonKhronosFramework(true); 18 } 19 20 description('Verify texImage2D and texSubImage2D code paths taking Videos'); 19 description('Verify texImage2D and texSubImage2D code paths taking Video Elements'); 21 20 22 21 var canvas = document.getElementById("example"); … … 29 28 textureLoc = gl.getUniformLocation(gl.program, "tex"); 30 29 31 var mediaFile = findMediaFile("video", "resources/quadrants"); 32 loadVideo(mediaFile); 30 var video = document.getElementById("vid"); 31 video.addEventListener( 32 "playing", function() { runTest(video); }, true); 33 video.play(); 33 34 } 34 35 35 function loadVideo(src) { 36 var video = document.getElementsByTagName('video')[0]; 36 // These two declarations need to be global for "shouldBe" to see them 37 var buf = null; 38 var idx = 0; 39 var pixel = [0, 0, 0]; 40 var correctColor = null; 37 41 38 function startVideo() { 39 // Resize canvas to fit video. 40 var canvas = document.getElementsByTagName('canvas')[0]; 41 canvas.width = video.videoWidth; 42 canvas.height = video.videoHeight; 43 44 runTest(video); 45 }; 46 video.addEventListener("canplay", startVideo); 47 video.src = src; 48 } 49 50 // These declarations need to be global for "shouldBe" to see them 51 var buf = null; 52 var bufWidth; 53 var bufHeight; 54 var red = [255, 0, 0, 255]; 55 var green = [0, 255, 0, 255]; 56 var blue = [0, 0, 255, 255]; 57 var yellow = [255, 255, 0, 255]; 58 var black = [0, 0, 0, 255]; 59 var clear = [127, 127, 127, 255]; 60 function pixelAt(x, y) { 61 var index = y * bufWidth * 4 + x * 4; 62 return [buf[index], buf[index+1], buf[index+2], buf[index+3]]; 63 } 64 65 function runOneIteration(video, flipY, useTexSubImage2D, ulColor, urColor, blColor, brColor, ox, oy, scale) { 66 var canvas = document.getElementsByTagName('canvas')[0]; 67 gl.viewport(0, 0, canvas.width, canvas.height); 68 42 function runOneIteration(videoElement, useTexSubImage2D, flipY, topColor, bottomColor) 43 { 44 debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') + 45 ' with flipY=' + flipY); 69 46 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); 70 47 // Disable any writes to the alpha channel 71 48 gl.colorMask(1, 1, 1, 0); 72 73 49 var texture = gl.createTexture(); 74 50 // Bind the texture to texture unit 0 … … 77 53 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); 78 54 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); 55 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); 56 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); 79 57 // Set up pixel store parameters 80 58 gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); 81 59 gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); 82 // Upload the imageinto the texture60 // Upload the videoElement into the texture 83 61 if (useTexSubImage2D) { 84 // Fill initial texture with black. 85 var texWidth = scale * canvas.width; 86 var texHeight = scale * canvas.height; 87 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, texWidth, texHeight, 0, 62 // Initialize the texture to black first 63 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64 videoElement.videoWidth, videoElement.videoHeight, 0, 88 65 gl.RGBA, gl.UNSIGNED_BYTE, null); 66 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, videoElement); 67 } else { 68 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, videoElement); 69 } 89 70 90 gl.texSubImage2D(gl.TEXTURE_2D, 0, ox * texWidth, oy * texHeight, gl.RGBA, gl.UNSIGNED_BYTE, video); 91 debug('Testing TexSubImage2D with flipY=' + flipY +', scale=' + scale + ', ox=' + ox + ', oy=' + oy); 92 } else { 93 debug('Testing texImage2D with flipY=' + flipY); 94 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video); 95 } 71 var c = document.createElement("canvas"); 72 c.width = 16; 73 c.height = 16; 74 c.style.border = "1px solid black"; 75 var ctx = c.getContext("2d"); 76 ctx.drawImage(videoElement, 0, 0, 16, 16); 77 document.body.appendChild(c); 96 78 97 79 // Point the uniform sampler to texture unit 0 98 80 gl.uniform1i(textureLoc, 0); 99 81 // Draw the triangles 100 wtu.drawQuad(gl, clear); 101 // Read back the rendering results 102 bufWidth = canvas.width; 103 bufHeight = canvas.height; 104 buf = new Uint8Array(bufWidth * bufHeight * 4); 105 gl.readPixels(0, 0, bufWidth, bufHeight, gl.RGBA, gl.UNSIGNED_BYTE, buf); 106 107 shouldBe("pixelAt(0, 0)", ulColor); 108 shouldBe("pixelAt(bufWidth-1, 0)", urColor); 109 shouldBe("pixelAt(0, bufHeight-1)", blColor); 110 shouldBe("pixelAt(bufWidth-1, bufHeight-1)", brColor); 82 wtu.drawQuad(gl, [0, 0, 0, 255]); 83 // Check a few pixels near the top and bottom and make sure they have 84 // the right color. 85 debug("Checking lower left corner"); 86 wtu.checkCanvasRect(gl, 4, 4, 2, 2, bottomColor, 87 "shouldBe " + bottomColor); 88 debug("Checking upper left corner"); 89 wtu.checkCanvasRect(gl, 4, gl.canvas.height - 8, 2, 2, topColor, 90 "shouldBe " + topColor); 111 91 } 112 92 113 function runTest(video )93 function runTest(videoElement) 114 94 { 115 // Original square should have red, green, yellow, blue quadrants,116 // with a cross in the middle:117 //118 // R|G119 // -+-120 // Y|B95 var red = [255, 0, 0]; 96 var green = [0, 255, 0]; 97 runOneIteration(videoElement, false, true, red, green); 98 runOneIteration(videoElement, false, false, green, red); 99 runOneIteration(videoElement, true, true, red, green); 100 runOneIteration(videoElement, true, false, green, red); 121 101 122 // texImage2D the whole texture 123 runOneIteration(video, false, false, "red", "green", "yellow", "blue"); 124 runOneIteration(video, true, false, "yellow", "blue", "red", "green"); 125 126 // texSubImage2D upper left 127 runOneIteration(video, false, true, "red", "black", "black", "black", 0, 0, 2); 128 runOneIteration(video, true, true, "yellow", "black", "black", "black", 0, 0, 2); 129 130 // texSubImage2D lower right 131 runOneIteration(video, false, true, "black", "black", "black", "blue", 0.5, 0.5, 2); 132 runOneIteration(video, true, true, "black", "black", "black", "green", 0.5, 0.5, 2); 133 134 successfullyParsed = true; 135 var epilogue = document.createElement("script"); 136 epilogue.onload = finish; 137 epilogue.src = "../../js/resources/js-test-post.js"; 138 document.body.appendChild(epilogue); 139 } 140 141 function finish() { 142 if (window.nonKhronosFrameworkNotifyDone) { 143 window.nonKhronosFrameworkNotifyDone(); 144 } 102 finishTest(); 145 103 } 146 104 </script> 147 105 </head> 148 106 <body onload="init()"> 149 <video id="sourcevideo"></video> 150 <canvas id="example"></canvas> 107 <canvas id="example" width="32px" height="32px"></canvas> 151 108 <div id="description"></div> 152 109 <div id="console"></div> 110 <video width="640" height="228" id="vid" controls> 111 <source src="resources/red-green.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> 112 <source src="resources/red-green.webmvp8.webm" type='video/webm; codecs="vp8, vorbis"' /> 113 <source src="resources/red-green.theora.ogv" type='video/ogg; codecs="theora, vorbis"' /> 114 </video> 153 115 </body> 154 116 </html> -
trunk/LayoutTests/platform/chromium-gpu/test_expectations.txt
r75530 r75570 201 201 BUGWEBGL : fast/canvas/webgl/css-webkit-canvas-repaint.html = IMAGE 202 202 BUGWEBGL : fast/canvas/webgl/css-webkit-canvas.html = IMAGE 203 BUGWEBGL WIN MAC : fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html = TEXT PASS204 203 BUGWEBGL WIN : fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view.html = CRASH PASS 205 204 BUGWEBGL : fast/canvas/webgl/gl-uniform-arrays.html = TEXT -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r75569 r75570 2544 2544 BUGWEBGL : fast/canvas/webgl/css-webkit-canvas-repaint.html = IMAGE 2545 2545 BUGWEBGL : fast/canvas/webgl/css-webkit-canvas.html = IMAGE 2546 BUGWEBGL WIN MAC : fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html = TEXT PASS2547 2546 BUGWEBGL WIN : fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view.html = CRASH PASS 2548 2547 BUGWEBGL WIN DEBUG : fast/canvas/webgl/texture-complete.html = PASS TEXT -
trunk/LayoutTests/platform/mac-snowleopard/Skipped
r75534 r75570 110 110 # https://bugs.webkit.org/show_bug.cgi?id=36925 111 111 fast/canvas/webgl/framebuffer-object-attachment.html 112 # The video upload test is failing on the bots for some currently unknown reason.113 # https://bugs.webkit.org/show_bug.cgi?id=44459114 fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html115 112 116 113 # https://bugs.webkit.org/show_bug.cgi?id=52237
Note: See TracChangeset
for help on using the changeset viewer.