summaryrefslogtreecommitdiffstats
path: root/WebCore/html/canvas/WebGLProgram.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/html/canvas/WebGLProgram.cpp')
-rw-r--r--WebCore/html/canvas/WebGLProgram.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/WebCore/html/canvas/WebGLProgram.cpp b/WebCore/html/canvas/WebGLProgram.cpp
index e4ffa80..b2c2086 100644
--- a/WebCore/html/canvas/WebGLProgram.cpp
+++ b/WebCore/html/canvas/WebGLProgram.cpp
@@ -41,23 +41,21 @@ PassRefPtr<WebGLProgram> WebGLProgram::create(WebGLRenderingContext* ctx)
WebGLProgram::WebGLProgram(WebGLRenderingContext* ctx)
: WebGLObject(ctx)
, m_linkStatus(false)
+ , m_linkCount(0)
{
setObject(context()->graphicsContext3D()->createProgram());
}
void WebGLProgram::deleteObjectImpl(Platform3DObject obj)
{
- if (!isDeleted())
- context()->graphicsContext3D()->deleteProgram(obj);
- if (!getAttachmentCount()) {
- if (m_vertexShader) {
- m_vertexShader->onDetached();
- m_vertexShader = 0;
- }
- if (m_fragmentShader) {
- m_fragmentShader->onDetached();
- m_fragmentShader = 0;
- }
+ context()->graphicsContext3D()->deleteProgram(obj);
+ if (m_vertexShader) {
+ m_vertexShader->onDetached();
+ m_vertexShader = 0;
+ }
+ if (m_fragmentShader) {
+ m_fragmentShader->onDetached();
+ m_fragmentShader = 0;
}
}
@@ -67,9 +65,9 @@ bool WebGLProgram::cacheActiveAttribLocations()
if (!object())
return false;
GraphicsContext3D* context3d = context()->graphicsContext3D();
- int linkStatus;
- context3d->getProgramiv(object(), GraphicsContext3D::LINK_STATUS, &linkStatus);
- if (!linkStatus)
+
+ // Assume link status has already been cached.
+ if (!m_linkStatus)
return false;
int numAttribs = 0;