2010-08-11 Zhenyao Mo <zmo@google.com>
authorzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Aug 2010 17:12:19 +0000 (17:12 +0000)
committerzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Aug 2010 17:12:19 +0000 (17:12 +0000)
commit1c635f38ab3e108363c5ea32785fad37ac7071de
tree0f18bcd828b591e33cf30ed6cb5f9ec53234b0bd
parent207b0f9232c26e4c4eb7810c97a991b5ad197b04
2010-08-11  Zhenyao Mo  <zmo@google.com>

        Reviewed by Dimitri Glazkov.

        Regression in linking of programs
        https://bugs.webkit.org/show_bug.cgi?id=43820

        Shaders and programs shouldn't be deleted until their attachments are removed, therefore, we need to track the attach/detach/useProgram.

        * html/canvas/WebGLObject.cpp: Track the object attachment count and whether it should really be deleted.
        (WebCore::WebGLObject::WebGLObject):
        (WebCore::WebGLObject::setObject):
        (WebCore::WebGLObject::deleteObject):
        * html/canvas/WebGLObject.h: Track the object attachment count and whether it should really be deleted.
        (WebCore::WebGLObject::onAttached):
        (WebCore::WebGLObject::onDetached):
        (WebCore::WebGLObject::getAttachmentCount):
        * html/canvas/WebGLProgram.cpp: Track the attached shaders.
        (WebCore::WebGLProgram::WebGLProgram):
        (WebCore::WebGLProgram::deleteObjectImpl):
        (WebCore::WebGLProgram::getAttachedShader):
        (WebCore::WebGLProgram::attachShader):
        (WebCore::WebGLProgram::detachShader):
        * html/canvas/WebGLProgram.h: Track the attached shaders.
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::attachShader): Track the attachment of a shader to a program.
        (WebCore::WebGLRenderingContext::deleteProgram): Detach shaders.
        (WebCore::WebGLRenderingContext::detachShader): Track the attachment of a shader to a program.
        (WebCore::WebGLRenderingContext::validateWebGLObject): Also check if object == 0.
        (WebCore::WebGLRenderingContext::linkProgram): Using the cached attached shaders instead of query from driver.
        (WebCore::WebGLRenderingContext::useProgram): Track the attachment of a program to the current rendering pipeline.
2010-08-11  Zhenyao Mo  <zmo@google.com>

        Reviewed by Dimitri Glazkov.

        Regression in linking of programs
        https://bugs.webkit.org/show_bug.cgi?id=43820

        * fast/canvas/webgl/program-test-expected.txt: Fix the tests so a second shader of the same type attaching to a program will generate error; also, add tests for deleteShader/deleteProgram behavior.
        * fast/canvas/webgl/program-test.html: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@65330 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/program-test-expected.txt
LayoutTests/fast/canvas/webgl/program-test.html
WebCore/ChangeLog
WebCore/html/canvas/WebGLObject.cpp
WebCore/html/canvas/WebGLObject.h
WebCore/html/canvas/WebGLProgram.cpp
WebCore/html/canvas/WebGLProgram.h
WebCore/html/canvas/WebGLRenderingContext.cpp