[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
zmo at google.com
zmo at google.com
Wed Dec 22 14:39:00 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 17a264eedb0040c1de6ad271d34513cdaa57de07
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 14 21:11:52 2010 +0000
2010-10-14 Zhenyao Mo <zmo at google.com>
Reviewed by Kenneth Russell.
Cache link status at linkProgram and use it in useProgram instead of querying GPU
https://bugs.webkit.org/show_bug.cgi?id=47685
* html/canvas/WebGLProgram.cpp: Always cache link status at linkStatus and use it upon query.
(WebCore::WebGLProgram::WebGLProgram):
* html/canvas/WebGLProgram.h: Ditto.
(WebCore::WebGLProgram::getLinkStatus):
(WebCore::WebGLProgram::setLinkStatus):
* html/canvas/WebGLRenderingContext.cpp: Ditto.
(WebCore::WebGLRenderingContext::getProgramParameter):
(WebCore::WebGLRenderingContext::linkProgram):
(WebCore::WebGLRenderingContext::useProgram):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69804 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index aa621bf..137c5e2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-10-14 Zhenyao Mo <zmo at google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Cache link status at linkProgram and use it in useProgram instead of querying GPU
+ https://bugs.webkit.org/show_bug.cgi?id=47685
+
+ * html/canvas/WebGLProgram.cpp: Always cache link status at linkStatus and use it upon query.
+ (WebCore::WebGLProgram::WebGLProgram):
+ * html/canvas/WebGLProgram.h: Ditto.
+ (WebCore::WebGLProgram::getLinkStatus):
+ (WebCore::WebGLProgram::setLinkStatus):
+ * html/canvas/WebGLRenderingContext.cpp: Ditto.
+ (WebCore::WebGLRenderingContext::getProgramParameter):
+ (WebCore::WebGLRenderingContext::linkProgram):
+ (WebCore::WebGLRenderingContext::useProgram):
+
2010-10-14 Justin Schuh <jschuh at chromium.org>
Reviewed by James Robinson.
diff --git a/WebCore/html/canvas/WebGLProgram.cpp b/WebCore/html/canvas/WebGLProgram.cpp
index 0853b67..e4ffa80 100644
--- a/WebCore/html/canvas/WebGLProgram.cpp
+++ b/WebCore/html/canvas/WebGLProgram.cpp
@@ -40,7 +40,7 @@ PassRefPtr<WebGLProgram> WebGLProgram::create(WebGLRenderingContext* ctx)
WebGLProgram::WebGLProgram(WebGLRenderingContext* ctx)
: WebGLObject(ctx)
- , m_linkFailure(false)
+ , m_linkStatus(false)
{
setObject(context()->graphicsContext3D()->createProgram());
}
diff --git a/WebCore/html/canvas/WebGLProgram.h b/WebCore/html/canvas/WebGLProgram.h
index e5548eb..3b88fdd 100644
--- a/WebCore/html/canvas/WebGLProgram.h
+++ b/WebCore/html/canvas/WebGLProgram.h
@@ -50,11 +50,8 @@ public:
bool isUsingVertexAttrib0() const;
- // Return true means getProgramParameter(LINK_STATUS) should return
- // false; return false means we should actually call
- // getProgramParameter(LINK_STATUS) to find out.
- bool isLinkFailureFlagSet() const { return m_linkFailure; }
- void setLinkFailureFlag(bool failed) { m_linkFailure = failed; }
+ bool getLinkStatus() const { return m_linkStatus; }
+ void setLinkStatus(bool status) { m_linkStatus = status; }
WebGLShader* getAttachedShader(GraphicsContext3D::WebGLEnumType);
bool attachShader(WebGLShader*);
@@ -70,7 +67,7 @@ private:
Vector<int> m_activeAttribLocations;
- bool m_linkFailure;
+ bool m_linkStatus;
RefPtr<WebGLShader> m_vertexShader;
RefPtr<WebGLShader> m_fragmentShader;
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 353a4b3..a8751da 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -1484,10 +1484,7 @@ WebGLGetInfo WebGLRenderingContext::getProgramParameter(WebGLProgram* program, u
m_context->getProgramiv(objectOrZero(program), pname, &value);
return WebGLGetInfo(static_cast<bool>(value));
case GraphicsContext3D::LINK_STATUS:
- if (program->isLinkFailureFlagSet())
- return WebGLGetInfo(false);
- m_context->getProgramiv(objectOrZero(program), pname, &value);
- return WebGLGetInfo(static_cast<bool>(value));
+ return WebGLGetInfo(program->getLinkStatus());
case GraphicsContext3D::INFO_LOG_LENGTH:
case GraphicsContext3D::ATTACHED_SHADERS:
case GraphicsContext3D::ACTIVE_ATTRIBUTES:
@@ -1897,14 +1894,17 @@ void WebGLRenderingContext::linkProgram(WebGLProgram* program, ExceptionCode& ec
return;
if (!isGLES2Compliant()) {
if (!program->getAttachedShader(GraphicsContext3D::VERTEX_SHADER) || !program->getAttachedShader(GraphicsContext3D::FRAGMENT_SHADER)) {
- program->setLinkFailureFlag(true);
+ program->setLinkStatus(false);
return;
}
- program->setLinkFailureFlag(false);
}
m_context->linkProgram(objectOrZero(program));
program->cacheActiveAttribLocations();
+ // cache link status
+ int value = 0;
+ m_context->getProgramiv(objectOrZero(program), GraphicsContext3D::LINK_STATUS, &value);
+ program->setLinkStatus(static_cast<bool>(value));
cleanupAfterGraphicsCall(false);
}
@@ -2714,11 +2714,12 @@ void WebGLRenderingContext::uniformMatrix4fv(const WebGLUniformLocation* locatio
void WebGLRenderingContext::useProgram(WebGLProgram* program, ExceptionCode& ec)
{
+ UNUSED_PARAM(ec);
if (program && program->context() != this) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
- if (program && program->object() && !getProgramParameter(program, GraphicsContext3D::LINK_STATUS, ec).getBool()) {
+ if (program && program->object() && !program->getLinkStatus()) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
cleanupAfterGraphicsCall(false);
return;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list