X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Fwebgl%2Fsrc%2Fsdk%2Ftests%2Fconformance%2Frendering%2Fpoint-with-gl-pointcoord-in-fragment-shader.html;h=d41e681f318e0d53721c7ffb9f7f54eb76640432;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=c5b8377c6ce95565d9d426e6d9020caae853f908;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/webgl/src/sdk/tests/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html b/src/third_party/webgl/src/sdk/tests/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html index c5b8377..d41e681 100644 --- a/src/third_party/webgl/src/sdk/tests/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html +++ b/src/third_party/webgl/src/sdk/tests/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html @@ -85,10 +85,6 @@ var canvasHeight = canvas.height; var output = document.getElementById("console"); var gl = wtu.create3DContext(canvas); -function withinRange(value, expected, delta) { - return Math.abs(value - expected) < delta; -} - function runTest() { var pointSizeRange = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE); // This test can't really run without a maximum point size of at least 2 @@ -130,17 +126,8 @@ function runTest() { gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0); gl.drawArrays(gl.POINTS, 0, 1); - var pixel = new Uint8Array(4); - // Read from approximately the center of the canvas - gl.readPixels(canvasWidth / 2, canvasHeight / 2, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); - if (withinRange(pixel[0], 0, 2) && - withinRange(pixel[1], 255, 2) && - withinRange(pixel[2], 0, 2) && - withinRange(pixel[3], 255, 2)) { - testPassed("Center pixel was green"); - } else { - testFailed("Center pixel was [" + pixel[0] + ", " + pixel[1] + ", " + pixel[2] + ", " + pixel[3] + "], should be [0, 255, 0, 255]"); - } + wtu.checkCanvasRect(gl, canvasWidth / 2, canvasHeight / 2, 1, 1, + [0, 255, 0, 255], "Center pixel should be green", 2); } runTest();