| Index: Source/core/html/canvas/WebGLProgram.cpp
|
| diff --git a/Source/core/html/canvas/WebGLProgram.cpp b/Source/core/html/canvas/WebGLProgram.cpp
|
| index 5581744f8bbc056fb5d9f67375f292393af78667..e87370d23dfb3d8693eb7b930a98bed25c739827 100644
|
| --- a/Source/core/html/canvas/WebGLProgram.cpp
|
| +++ b/Source/core/html/canvas/WebGLProgram.cpp
|
| @@ -64,39 +64,40 @@ void WebGLProgram::deleteObjectImpl(GraphicsContext3D* context3d, Platform3DObje
|
| }
|
| }
|
|
|
| -unsigned WebGLProgram::numActiveAttribLocations()
|
| +unsigned WebGLProgram::numActiveAttribLocations(WebGLRenderingContext* context)
|
| {
|
| - cacheInfoIfNeeded();
|
| + cacheInfoIfNeeded(context);
|
| return m_activeAttribLocations.size();
|
| }
|
|
|
| -GC3Dint WebGLProgram::getActiveAttribLocation(GC3Duint index)
|
| +GC3Dint WebGLProgram::getActiveAttribLocation(WebGLRenderingContext* context, GC3Duint index)
|
| {
|
| - cacheInfoIfNeeded();
|
| - if (index >= numActiveAttribLocations())
|
| + cacheInfoIfNeeded(context);
|
| + if (index >= numActiveAttribLocations(context))
|
| return -1;
|
| return m_activeAttribLocations[index];
|
| }
|
|
|
| -bool WebGLProgram::isUsingVertexAttrib0()
|
| +bool WebGLProgram::isUsingVertexAttrib0(WebGLRenderingContext* context)
|
| {
|
| - cacheInfoIfNeeded();
|
| - for (unsigned ii = 0; ii < numActiveAttribLocations(); ++ii) {
|
| - if (!getActiveAttribLocation(ii))
|
| + cacheInfoIfNeeded(context);
|
| + unsigned numLocations = numActiveAttribLocations(context);
|
| + for (unsigned ii = 0; ii < numLocations; ++ii) {
|
| + if (!getActiveAttribLocation(context, ii))
|
| return true;
|
| }
|
| return false;
|
| }
|
|
|
| -bool WebGLProgram::getLinkStatus()
|
| +bool WebGLProgram::getLinkStatus(WebGLRenderingContext* context)
|
| {
|
| - cacheInfoIfNeeded();
|
| + cacheInfoIfNeeded(context);
|
| return m_linkStatus;
|
| }
|
|
|
| -void WebGLProgram::setLinkStatus(bool status)
|
| +void WebGLProgram::setLinkStatus(WebGLRenderingContext* context, bool status)
|
| {
|
| - cacheInfoIfNeeded();
|
| + cacheInfoIfNeeded(context);
|
| m_linkStatus = status;
|
| }
|
|
|
| @@ -172,7 +173,7 @@ void WebGLProgram::cacheActiveAttribLocations(GraphicsContext3D* context3d)
|
| }
|
| }
|
|
|
| -void WebGLProgram::cacheInfoIfNeeded()
|
| +void WebGLProgram::cacheInfoIfNeeded(WebGLRenderingContext* context)
|
| {
|
| if (m_infoValid)
|
| return;
|
| @@ -180,14 +181,14 @@ void WebGLProgram::cacheInfoIfNeeded()
|
| if (!object())
|
| return;
|
|
|
| - GraphicsContext3D* context = getAGraphicsContext3D();
|
| + GraphicsContext3D* gc3d = context->graphicsContext3D();
|
| if (!context)
|
| return;
|
| GC3Dint linkStatus = 0;
|
| - context->getProgramiv(object(), GraphicsContext3D::LINK_STATUS, &linkStatus);
|
| + gc3d->getProgramiv(object(), GraphicsContext3D::LINK_STATUS, &linkStatus);
|
| m_linkStatus = linkStatus;
|
| if (m_linkStatus)
|
| - cacheActiveAttribLocations(context);
|
| + cacheActiveAttribLocations(gc3d);
|
| m_infoValid = true;
|
| }
|
|
|
|
|