Changeset 69804 in webkit
- Timestamp:
- Oct 14, 2010 2:11:52 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r69801 r69804 1 2010-10-14 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 Cache link status at linkProgram and use it in useProgram instead of querying GPU 6 https://bugs.webkit.org/show_bug.cgi?id=47685 7 8 * html/canvas/WebGLProgram.cpp: Always cache link status at linkStatus and use it upon query. 9 (WebCore::WebGLProgram::WebGLProgram): 10 * html/canvas/WebGLProgram.h: Ditto. 11 (WebCore::WebGLProgram::getLinkStatus): 12 (WebCore::WebGLProgram::setLinkStatus): 13 * html/canvas/WebGLRenderingContext.cpp: Ditto. 14 (WebCore::WebGLRenderingContext::getProgramParameter): 15 (WebCore::WebGLRenderingContext::linkProgram): 16 (WebCore::WebGLRenderingContext::useProgram): 17 1 18 2010-10-14 Justin Schuh <jschuh@chromium.org> 2 19 -
trunk/WebCore/html/canvas/WebGLProgram.cpp
r68424 r69804 41 41 WebGLProgram::WebGLProgram(WebGLRenderingContext* ctx) 42 42 : WebGLObject(ctx) 43 , m_link Failure(false)43 , m_linkStatus(false) 44 44 { 45 45 setObject(context()->graphicsContext3D()->createProgram()); -
trunk/WebCore/html/canvas/WebGLProgram.h
r65330 r69804 51 51 bool isUsingVertexAttrib0() const; 52 52 53 // Return true means getProgramParameter(LINK_STATUS) should return 54 // false; return false means we should actually call 55 // getProgramParameter(LINK_STATUS) to find out. 56 bool isLinkFailureFlagSet() const { return m_linkFailure; } 57 void setLinkFailureFlag(bool failed) { m_linkFailure = failed; } 53 bool getLinkStatus() const { return m_linkStatus; } 54 void setLinkStatus(bool status) { m_linkStatus = status; } 58 55 59 56 WebGLShader* getAttachedShader(GraphicsContext3D::WebGLEnumType); … … 71 68 Vector<int> m_activeAttribLocations; 72 69 73 bool m_link Failure;70 bool m_linkStatus; 74 71 75 72 RefPtr<WebGLShader> m_vertexShader; -
trunk/WebCore/html/canvas/WebGLRenderingContext.cpp
r69619 r69804 1485 1485 return WebGLGetInfo(static_cast<bool>(value)); 1486 1486 case GraphicsContext3D::LINK_STATUS: 1487 if (program->isLinkFailureFlagSet()) 1488 return WebGLGetInfo(false); 1489 m_context->getProgramiv(objectOrZero(program), pname, &value); 1490 return WebGLGetInfo(static_cast<bool>(value)); 1487 return WebGLGetInfo(program->getLinkStatus()); 1491 1488 case GraphicsContext3D::INFO_LOG_LENGTH: 1492 1489 case GraphicsContext3D::ATTACHED_SHADERS: … … 1898 1895 if (!isGLES2Compliant()) { 1899 1896 if (!program->getAttachedShader(GraphicsContext3D::VERTEX_SHADER) || !program->getAttachedShader(GraphicsContext3D::FRAGMENT_SHADER)) { 1900 program->setLink FailureFlag(true);1897 program->setLinkStatus(false); 1901 1898 return; 1902 1899 } 1903 program->setLinkFailureFlag(false);1904 1900 } 1905 1901 1906 1902 m_context->linkProgram(objectOrZero(program)); 1907 1903 program->cacheActiveAttribLocations(); 1904 // cache link status 1905 int value = 0; 1906 m_context->getProgramiv(objectOrZero(program), GraphicsContext3D::LINK_STATUS, &value); 1907 program->setLinkStatus(static_cast<bool>(value)); 1908 1908 cleanupAfterGraphicsCall(false); 1909 1909 } … … 2715 2715 void WebGLRenderingContext::useProgram(WebGLProgram* program, ExceptionCode& ec) 2716 2716 { 2717 UNUSED_PARAM(ec); 2717 2718 if (program && program->context() != this) { 2718 2719 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 2719 2720 return; 2720 2721 } 2721 if (program && program->object() && ! getProgramParameter(program, GraphicsContext3D::LINK_STATUS, ec).getBool()) {2722 if (program && program->object() && !program->getLinkStatus()) { 2722 2723 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 2723 2724 cleanupAfterGraphicsCall(false);
Note: See TracChangeset
for help on using the changeset viewer.