2010-12-03 Zhenyao Mo <zmo@google.com>
authorzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Dec 2010 23:16:58 +0000 (23:16 +0000)
committerzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Dec 2010 23:16:58 +0000 (23:16 +0000)
commit179a709bcc5138ae19db9c7339488010574ca2f5
tree3ae8c186e286995683c6ddc2ada2bc2ac27e4fec
parentf425590fe66099cd88672655e1b9df8745c86444
2010-12-03  Zhenyao Mo  <zmo@google.com>

        Reviewed by Kenneth Russell.

        Postpone gl delete* calls until shaders/programs are no longer attached
        https://bugs.webkit.org/show_bug.cgi?id=50501

        * html/canvas/WebGLBuffer.cpp:
        (WebCore::WebGLBuffer::deleteObjectImpl): Simply delete GL resource.
        * html/canvas/WebGLFramebuffer.cpp:
        (WebCore::WebGLFramebuffer::deleteObjectImpl): Ditto.
        * html/canvas/WebGLObject.cpp:
        (WebCore::WebGLObject::deleteObject): Tracking whether deleteObjectImpl should be called or not.
        * html/canvas/WebGLObject.h:
        (WebCore::WebGLObject::detachContext): Set attachmentCount to 0 to ensure OpenGL resource deletion.
        (WebCore::WebGLObject::onDetached): No need to track attachmentCount here as we track it in deleteObject.
        (WebCore::WebGLObject::isDeleted): Make this public.
        * html/canvas/WebGLProgram.cpp:
        (WebCore::WebGLProgram::deleteObjectImpl): Simply delete GL resource.
        * html/canvas/WebGLRenderbuffer.cpp:
        (WebCore::WebGLRenderbuffer::deleteObjectImpl): Ditto.
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::getProgramParameter): intercept DELETE_STATUS.
        (WebCore::WebGLRenderingContext::getShaderParameter): Ditto.
        * html/canvas/WebGLShader.cpp:
        (WebCore::WebGLShader::deleteObjectImpl): Simply delete GL resource.
        * html/canvas/WebGLTexture.cpp:
        (WebCore::WebGLTexture::deleteObjectImpl): Simply delete GL resource.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/html/canvas/WebGLBuffer.cpp
WebCore/html/canvas/WebGLFramebuffer.cpp
WebCore/html/canvas/WebGLObject.cpp
WebCore/html/canvas/WebGLObject.h
WebCore/html/canvas/WebGLProgram.cpp
WebCore/html/canvas/WebGLRenderbuffer.cpp
WebCore/html/canvas/WebGLRenderingContext.cpp
WebCore/html/canvas/WebGLShader.cpp
WebCore/html/canvas/WebGLTexture.cpp