Commit c32d3816 authored by eric@webkit.org's avatar eric@webkit.org

2010-05-19 Zhenyao Mo <zmo@google.com>

        Reviewed by Darin Adler.

        fast/canvas/webgl/texture-npot.html failed on leopard bot
        https://bugs.webkit.org/show_bug.cgi?id=39128

        * fast/canvas/webgl/texture-npot-expected.txt: Skip pixel (0, 0); print out actual color when failing.
        * fast/canvas/webgl/texture-npot.html: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 11eb0070
2010-05-19 Zhenyao Mo <zmo@google.com>
Reviewed by Darin Adler.
fast/canvas/webgl/texture-npot.html failed on leopard bot
https://bugs.webkit.org/show_bug.cgi?id=39128
* fast/canvas/webgl/texture-npot-expected.txt: Skip pixel (0, 0); print out actual color when failing.
* fast/canvas/webgl/texture-npot.html: Ditto.
2010-05-19 Ben Murdoch <benm@google.com>
Reviewed by Darin Adler.
......@@ -3,6 +3,9 @@ WebGL NPOT texture conformance test
PASS gl.texImage2D with NPOT texture with level > 0 should return INVALID_VALUE
PASS gl.texImage2D with NPOT texture at level 0 should succeed
PASS gl.generateMipmap with NPOT texture should return INVALID_OPERATION
PASS NPOT texture with TEXTURE_WRAP set to REPEAT should draw with 0,0,0,255
PASS NPOT texture with TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255
PASS NPOT texture with TEXTURE_MIN_FILTER set to LINEAR should draw with 0,192,128,255
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -101,26 +101,23 @@
var loc = gl.getUniformLocation(gl.program, "tex");
gl.uniform1i(loc, 0);
// FIXME: uncomment the three chechBuffer calls once we figure out why they fail on the Leopard bot.
// https://bugs.webkit.org/show_bug.cgi?id=39128
// 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);
// checkBuffer(0,0,0,255, "NPOT texture with TEXTURE_WRAP set to REPEAT should draw with 0,0,0,255");
checkBuffer(0,0,0,255, "NPOT texture with TEXTURE_WRAP set to REPEAT should draw with 0,0,0,255");
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);
// checkBuffer(0,0,0,255, "NPOT texture with TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255");
checkBuffer(0,0,0,255, "NPOT texture with TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255");
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
// checkBuffer(0,192,128,255, "NPOT texture with TEXTURE_MIN_FILTER set to LINEAR should draw.");
checkBuffer(0,192,128,255, "NPOT texture with TEXTURE_MIN_FILTER set to LINEAR should draw with 0,192,128,255");
function checkBuffer(r, g, b, a, msg) {
gl.clearColor(1,1,1,1);
......@@ -129,12 +126,17 @@
gl.flush();
var buf = gl.readPixels(0, 0, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE);
for (var i = 0; i < 4 * 4; ++i) {
// We skip the (0, 0) pixel due to a possible bug on the Leopard bot.
// https://bugs.webkit.org/show_bug.cgi?id=39128.
if (i == 0)
continue;
var offset = i * 4;
if (buf[offset + 0] != r ||
buf[offset + 1] != g ||
buf[offset + 2] != b ||
buf[offset + 3] != a) {
testFailed(msg);
testFailed(msg + ', read back color is ' + buf[offset + 0] + ',' + buf[offset + 1]
+ ',' + buf[offset + 2] + ',' + buf[offset + 3]);
return;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment