Commit 193c5f86 authored by eric@webkit.org's avatar eric@webkit.org

2010-03-04 Vangelis Kokkevis <vangelis@chromium.org>

        Reviewed by Oliver Hunt.

        Update existing test to check that getUniformLocation() returns
        null if the uniform requested is not found.
        https://bugs.webkit.org/show_bug.cgi?id=34669

        * fast/canvas/webgl/script-tests/uniform-location.js:
        * fast/canvas/webgl/uniform-location-expected.txt:
2010-03-04  Vangelis Kokkevis  <vangelis@chromium.org>

        Reviewed by Oliver Hunt.

        getUniformLocation() now returns null if uniform requested
        is not found.
        https://bugs.webkit.org/show_bug.cgi?id=34669

        Test:LayoutTests/fast/canvas/webgl/uniform-location.html
        (added missing test)

        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::getUniformLocation):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 61ccc4b3
2010-03-04 Vangelis Kokkevis <vangelis@chromium.org>
Reviewed by Oliver Hunt.
Update existing test to check that getUniformLocation() returns
null if the uniform requested is not found.
https://bugs.webkit.org/show_bug.cgi?id=34669
* fast/canvas/webgl/script-tests/uniform-location.js:
* fast/canvas/webgl/uniform-location-expected.txt:
2010-03-04 John Abd-El-Malek <jam@chromium.org>
Reviewed by Adam Barth.
......
description("Tests calling WebGL APIs with objects from other contexts");
description("Tests WebGL APIs related to shader uniforms");
var contextA = create3DDebugContext();
var contextB = create3DDebugContext();
......@@ -33,4 +33,6 @@ shouldBeUndefined("contextA.useProgram(programV)");
shouldBeUndefined("contextA.uniform4fv(locationVec4, vec)");
shouldBe("contextA.getUniform(programV, locationVec4)", "vec");
shouldBeNull("contextA.getUniformLocation(programV, \"IDontExist\")");
successfullyParsed = true;
Tests calling WebGL APIs with objects from other contexts
Tests WebGL APIs related to shader uniforms
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
......@@ -15,6 +15,7 @@ PASS contextA.getUniform(programS, locationArray0) is 4.0
PASS contextA.useProgram(programV) is undefined.
PASS contextA.uniform4fv(locationVec4, vec) is undefined.
PASS contextA.getUniform(programV, locationVec4) is vec
PASS contextA.getUniformLocation(programV, "IDontExist") is null
PASS successfullyParsed is true
TEST COMPLETE
......
2010-03-04 Vangelis Kokkevis <vangelis@chromium.org>
Reviewed by Oliver Hunt.
getUniformLocation() now returns null if uniform requested
is not found.
https://bugs.webkit.org/show_bug.cgi?id=34669
Test:LayoutTests/fast/canvas/webgl/uniform-location.html
(added missing test)
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getUniformLocation):
2010-03-04 John Abd-El-Malek <jam@chromium.org>
Reviewed by Adam Barth.
......
......@@ -1399,7 +1399,10 @@ PassRefPtr<WebGLUniformLocation> WebGLRenderingContext::getUniformLocation(WebGL
return 0;
}
WebGLStateRestorer(this, false);
return WebGLUniformLocation::create(program, m_context->getUniformLocation(program, name));
long uniformLocation = m_context->getUniformLocation(program, name);
if (uniformLocation == -1)
return 0;
return WebGLUniformLocation::create(program, uniformLocation);
}
WebGLGetInfo WebGLRenderingContext::getVertexAttrib(unsigned long index, unsigned long pname, ExceptionCode& ec)
......
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