Index: trunk/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
=================================================================== |
--- trunk/Source/core/html/canvas/WebGLRenderingContextBase.cpp (revision 168480) |
+++ trunk/Source/core/html/canvas/WebGLRenderingContextBase.cpp (working copy) |
@@ -126,7 +126,7 @@ |
size_t candidateID = 0; |
for (size_t ii = 1; ii < activeContexts().size(); ++ii) { |
WebGLRenderingContextBase* context = activeContexts()[ii]; |
- if (context->webContext() && candidate->webContext() && context->webContext()->lastFlushID() < candidate->webContext()->lastFlushID()) { |
+ if (context->webGraphicsContext3D() && candidate->webGraphicsContext3D() && context->webGraphicsContext3D()->lastFlushID() < candidate->webGraphicsContext3D()->lastFlushID()) { |
candidate = context; |
candidateID = ii; |
} |
@@ -483,6 +483,7 @@ |
WebGLRenderingContextBase::WebGLRenderingContextBase(HTMLCanvasElement* passedCanvas, PassOwnPtr<blink::WebGraphicsContext3D> context, WebGLContextAttributes* requestedAttributes) |
: CanvasRenderingContext(passedCanvas) |
, ActiveDOMObject(&passedCanvas->document()) |
+ , m_context(context) |
, m_drawingBuffer(nullptr) |
, m_dispatchContextLostEventTimer(this, &WebGLRenderingContextBase::dispatchContextLostEvent) |
, m_restoreAllowed(false) |
@@ -498,26 +499,26 @@ |
, m_onePlusMaxEnabledAttribIndex(0) |
, m_onePlusMaxNonDefaultTextureUnit(0) |
{ |
- ASSERT(context); |
+ ASSERT(m_context); |
ScriptWrappable::init(this); |
m_contextGroup = WebGLContextGroup::create(); |
m_contextGroup->addContext(this); |
m_maxViewportDims[0] = m_maxViewportDims[1] = 0; |
- context->getIntegerv(GL_MAX_VIEWPORT_DIMS, m_maxViewportDims); |
+ m_context->getIntegerv(GL_MAX_VIEWPORT_DIMS, m_maxViewportDims); |
RefPtr<WebGLRenderingContextEvictionManager> contextEvictionManager = adoptRef(new WebGLRenderingContextEvictionManager()); |
// Create the DrawingBuffer and initialize the platform layer. |
DrawingBuffer::PreserveDrawingBuffer preserve = requestedAttributes->preserveDrawingBuffer() ? DrawingBuffer::Preserve : DrawingBuffer::Discard; |
- m_drawingBuffer = DrawingBuffer::create(context, clampedCanvasSize(), preserve, contextEvictionManager.release()); |
- if (!m_drawingBuffer) |
- return; |
+ m_drawingBuffer = DrawingBuffer::create(m_context.get(), clampedCanvasSize(), preserve, contextEvictionManager.release()); |
- m_drawingBuffer->bind(); |
- setupFlags(); |
- initializeNewContext(); |
+ if (!m_drawingBuffer->isZeroSized()) { |
+ m_drawingBuffer->bind(); |
+ setupFlags(); |
+ initializeNewContext(); |
+ } |
} |
void WebGLRenderingContextBase::initializeNewContext() |
@@ -553,22 +554,22 @@ |
m_colorMask[0] = m_colorMask[1] = m_colorMask[2] = m_colorMask[3] = true; |
GLint numCombinedTextureImageUnits = 0; |
- webContext()->getIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &numCombinedTextureImageUnits); |
+ m_context->getIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &numCombinedTextureImageUnits); |
m_textureUnits.clear(); |
m_textureUnits.resize(numCombinedTextureImageUnits); |
GLint numVertexAttribs = 0; |
- webContext()->getIntegerv(GL_MAX_VERTEX_ATTRIBS, &numVertexAttribs); |
+ m_context->getIntegerv(GL_MAX_VERTEX_ATTRIBS, &numVertexAttribs); |
m_maxVertexAttribs = numVertexAttribs; |
m_maxTextureSize = 0; |
- webContext()->getIntegerv(GL_MAX_TEXTURE_SIZE, &m_maxTextureSize); |
+ m_context->getIntegerv(GL_MAX_TEXTURE_SIZE, &m_maxTextureSize); |
m_maxTextureLevel = WebGLTexture::computeLevelCount(m_maxTextureSize, m_maxTextureSize); |
m_maxCubeMapTextureSize = 0; |
- webContext()->getIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &m_maxCubeMapTextureSize); |
+ m_context->getIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &m_maxCubeMapTextureSize); |
m_maxCubeMapTextureLevel = WebGLTexture::computeLevelCount(m_maxCubeMapTextureSize, m_maxCubeMapTextureSize); |
m_maxRenderbufferSize = 0; |
- webContext()->getIntegerv(GL_MAX_RENDERBUFFER_SIZE, &m_maxRenderbufferSize); |
+ m_context->getIntegerv(GL_MAX_RENDERBUFFER_SIZE, &m_maxRenderbufferSize); |
// These two values from EXT_draw_buffers are lazily queried. |
m_maxDrawBuffers = 0; |
@@ -584,17 +585,19 @@ |
createFallbackBlackTextures1x1(); |
- webContext()->viewport(0, 0, drawingBufferWidth(), drawingBufferHeight()); |
- webContext()->scissor(0, 0, drawingBufferWidth(), drawingBufferHeight()); |
+ m_drawingBuffer->reset(clampedCanvasSize()); |
+ m_context->viewport(0, 0, drawingBufferWidth(), drawingBufferHeight()); |
+ m_context->scissor(0, 0, drawingBufferWidth(), drawingBufferHeight()); |
+ |
m_contextLostCallbackAdapter = adoptPtr(new WebGLRenderingContextLostCallback(this)); |
m_errorMessageCallbackAdapter = adoptPtr(new WebGLRenderingContextErrorMessageCallback(this)); |
- webContext()->setContextLostCallback(m_contextLostCallbackAdapter.get()); |
- webContext()->setErrorMessageCallback(m_errorMessageCallbackAdapter.get()); |
+ m_context->setContextLostCallback(m_contextLostCallbackAdapter.get()); |
+ m_context->setErrorMessageCallback(m_errorMessageCallbackAdapter.get()); |
// This ensures that the context has a valid "lastFlushID" and won't be mistakenly identified as the "least recently used" context. |
- webContext()->flush(); |
+ m_context->flush(); |
for (int i = 0; i < WebGLExtensionNameCount; ++i) |
m_extensionEnabled[i] = false; |
@@ -604,7 +607,7 @@ |
void WebGLRenderingContextBase::setupFlags() |
{ |
- ASSERT(m_drawingBuffer); |
+ ASSERT(m_context); |
if (Page* p = canvas()->document().page()) { |
m_synthesizedErrorsToConsole = p->settings().webGLErrorsToConsoleEnabled(); |
@@ -695,16 +698,17 @@ |
{ |
m_contextLost = true; |
- if (!m_drawingBuffer) |
- return; |
+ // The drawing buffer holds a context reference. It must also be destroyed |
+ // in order for the context to be released. |
+ m_drawingBuffer->releaseResources(); |
m_extensionsUtil.clear(); |
- webContext()->setContextLostCallback(0); |
- webContext()->setErrorMessageCallback(0); |
- |
- ASSERT(m_drawingBuffer); |
- m_drawingBuffer.clear(); |
+ if (m_context) { |
+ m_context->setContextLostCallback(0); |
+ m_context->setErrorMessageCallback(0); |
+ m_context.clear(); |
+ } |
} |
void WebGLRenderingContextBase::markContextChanged() |
@@ -742,37 +746,36 @@ |
// Determine if it's possible to combine the clear the user asked for and this clear. |
bool combinedClear = mask && !m_scissorEnabled; |
- webContext()->disable(GL_SCISSOR_TEST); |
- if (combinedClear && (mask & GL_COLOR_BUFFER_BIT)) { |
- webContext()->clearColor(m_colorMask[0] ? m_clearColor[0] : 0, |
- m_colorMask[1] ? m_clearColor[1] : 0, |
- m_colorMask[2] ? m_clearColor[2] : 0, |
- m_colorMask[3] ? m_clearColor[3] : 0); |
- } else { |
- webContext()->clearColor(0, 0, 0, 0); |
- } |
- webContext()->colorMask(true, true, true, true); |
+ m_context->disable(GL_SCISSOR_TEST); |
+ if (combinedClear && (mask & GL_COLOR_BUFFER_BIT)) |
+ m_context->clearColor(m_colorMask[0] ? m_clearColor[0] : 0, |
+ m_colorMask[1] ? m_clearColor[1] : 0, |
+ m_colorMask[2] ? m_clearColor[2] : 0, |
+ m_colorMask[3] ? m_clearColor[3] : 0); |
+ else |
+ m_context->clearColor(0, 0, 0, 0); |
+ m_context->colorMask(true, true, true, true); |
GLbitfield clearMask = GL_COLOR_BUFFER_BIT; |
if (contextAttributes->depth()) { |
if (!combinedClear || !m_depthMask || !(mask & GL_DEPTH_BUFFER_BIT)) |
- webContext()->clearDepth(1.0f); |
+ m_context->clearDepth(1.0f); |
clearMask |= GL_DEPTH_BUFFER_BIT; |
- webContext()->depthMask(true); |
+ m_context->depthMask(true); |
} |
if (contextAttributes->stencil()) { |
if (combinedClear && (mask & GL_STENCIL_BUFFER_BIT)) |
- webContext()->clearStencil(m_clearStencil & m_stencilMask); |
+ m_context->clearStencil(m_clearStencil & m_stencilMask); |
else |
- webContext()->clearStencil(0); |
+ m_context->clearStencil(0); |
clearMask |= GL_STENCIL_BUFFER_BIT; |
- webContext()->stencilMaskSeparate(GL_FRONT, 0xFFFFFFFF); |
+ m_context->stencilMaskSeparate(GL_FRONT, 0xFFFFFFFF); |
} |
m_drawingBuffer->clearFramebuffers(clearMask); |
restoreStateAfterClear(); |
if (m_framebufferBinding) |
- webContext()->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebufferBinding.get())); |
+ m_context->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebufferBinding.get())); |
m_layerCleared = true; |
return combinedClear; |
@@ -785,15 +788,15 @@ |
// Restore the state that the context set. |
if (m_scissorEnabled) |
- webContext()->enable(GL_SCISSOR_TEST); |
- webContext()->clearColor(m_clearColor[0], m_clearColor[1], |
- m_clearColor[2], m_clearColor[3]); |
- webContext()->colorMask(m_colorMask[0], m_colorMask[1], |
- m_colorMask[2], m_colorMask[3]); |
- webContext()->clearDepth(m_clearDepth); |
- webContext()->clearStencil(m_clearStencil); |
- webContext()->stencilMaskSeparate(GL_FRONT, m_stencilMask); |
- webContext()->depthMask(m_depthMask); |
+ m_context->enable(GL_SCISSOR_TEST); |
+ m_context->clearColor(m_clearColor[0], m_clearColor[1], |
+ m_clearColor[2], m_clearColor[3]); |
+ m_context->colorMask(m_colorMask[0], m_colorMask[1], |
+ m_colorMask[2], m_colorMask[3]); |
+ m_context->clearDepth(m_clearDepth); |
+ m_context->clearStencil(m_clearStencil); |
+ m_context->stencilMaskSeparate(GL_FRONT, m_stencilMask); |
+ m_context->depthMask(m_depthMask); |
} |
void WebGLRenderingContextBase::markLayerComposited() |
@@ -836,7 +839,7 @@ |
} |
if (m_framebufferBinding) |
- webContext()->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebufferBinding.get())); |
+ m_context->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebufferBinding.get())); |
else |
m_drawingBuffer->bind(); |
} |
@@ -854,7 +857,7 @@ |
return nullptr; |
if (m_framebufferBinding) |
- webContext()->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebufferBinding.get())); |
+ m_context->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebufferBinding.get())); |
else |
m_drawingBuffer->bind(); |
@@ -889,20 +892,20 @@ |
m_drawingBuffer->reset(IntSize(width, height)); |
restoreStateAfterClear(); |
- webContext()->bindTexture(GL_TEXTURE_2D, objectOrZero(m_textureUnits[m_activeTextureUnit].m_texture2DBinding.get())); |
- webContext()->bindRenderbuffer(GL_RENDERBUFFER, objectOrZero(m_renderbufferBinding.get())); |
+ m_context->bindTexture(GL_TEXTURE_2D, objectOrZero(m_textureUnits[m_activeTextureUnit].m_texture2DBinding.get())); |
+ m_context->bindRenderbuffer(GL_RENDERBUFFER, objectOrZero(m_renderbufferBinding.get())); |
if (m_framebufferBinding) |
- webContext()->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebufferBinding.get())); |
+ m_context->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebufferBinding.get())); |
} |
int WebGLRenderingContextBase::drawingBufferWidth() const |
{ |
- return isContextLost() ? 0 : m_drawingBuffer->size().width(); |
+ return m_drawingBuffer->size().width(); |
} |
int WebGLRenderingContextBase::drawingBufferHeight() const |
{ |
- return isContextLost() ? 0 : m_drawingBuffer->size().height(); |
+ return m_drawingBuffer->size().height(); |
} |
unsigned WebGLRenderingContextBase::sizeInBytes(GLenum type) |
@@ -936,7 +939,7 @@ |
return; |
} |
m_activeTextureUnit = texture - GL_TEXTURE0; |
- webContext()->activeTexture(texture); |
+ m_context->activeTexture(texture); |
m_drawingBuffer->setActiveTextureUnit(texture); |
@@ -950,7 +953,7 @@ |
synthesizeGLError(GL_INVALID_OPERATION, "attachShader", "shader attachment already has shader"); |
return; |
} |
- webContext()->attachShader(objectOrZero(program), objectOrZero(shader)); |
+ m_context->attachShader(objectOrZero(program), objectOrZero(shader)); |
shader->onAttached(); |
} |
@@ -970,7 +973,7 @@ |
synthesizeGLError(GL_INVALID_VALUE, "bindAttribLocation", "index out of range"); |
return; |
} |
- webContext()->bindAttribLocation(objectOrZero(program), index, name.utf8().data()); |
+ m_context->bindAttribLocation(objectOrZero(program), index, name.utf8().data()); |
} |
bool WebGLRenderingContextBase::checkObjectToBeBound(const char* functionName, WebGLObject* object, bool& deleted) |
@@ -1008,7 +1011,7 @@ |
return; |
} |
- webContext()->bindBuffer(target, objectOrZero(buffer)); |
+ m_context->bindBuffer(target, objectOrZero(buffer)); |
if (buffer) |
buffer->setTarget(target); |
} |
@@ -1029,9 +1032,8 @@ |
if (!m_framebufferBinding) { |
// Instead of binding fb 0, bind the drawing buffer. |
m_drawingBuffer->bind(); |
- } else { |
- webContext()->bindFramebuffer(target, objectOrZero(buffer)); |
- } |
+ } else |
+ m_context->bindFramebuffer(target, objectOrZero(buffer)); |
if (buffer) |
buffer->setHasEverBeenBound(); |
applyStencilTest(); |
@@ -1049,7 +1051,7 @@ |
return; |
} |
m_renderbufferBinding = renderBuffer; |
- webContext()->bindRenderbuffer(target, objectOrZero(renderBuffer)); |
+ m_context->bindRenderbuffer(target, objectOrZero(renderBuffer)); |
if (renderBuffer) |
renderBuffer->setHasEverBeenBound(); |
} |
@@ -1081,7 +1083,7 @@ |
return; |
} |
- webContext()->bindTexture(target, objectOrZero(texture)); |
+ m_context->bindTexture(target, objectOrZero(texture)); |
if (texture) { |
texture->setTarget(target, maxLevel); |
m_onePlusMaxNonDefaultTextureUnit = max(m_activeTextureUnit + 1, m_onePlusMaxNonDefaultTextureUnit); |
@@ -1107,21 +1109,21 @@ |
{ |
if (isContextLost()) |
return; |
- webContext()->blendColor(red, green, blue, alpha); |
+ m_context->blendColor(red, green, blue, alpha); |
} |
void WebGLRenderingContextBase::blendEquation(GLenum mode) |
{ |
if (isContextLost() || !validateBlendEquation("blendEquation", mode)) |
return; |
- webContext()->blendEquation(mode); |
+ m_context->blendEquation(mode); |
} |
void WebGLRenderingContextBase::blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) |
{ |
if (isContextLost() || !validateBlendEquation("blendEquationSeparate", modeRGB) || !validateBlendEquation("blendEquationSeparate", modeAlpha)) |
return; |
- webContext()->blendEquationSeparate(modeRGB, modeAlpha); |
+ m_context->blendEquationSeparate(modeRGB, modeAlpha); |
} |
@@ -1129,7 +1131,7 @@ |
{ |
if (isContextLost() || !validateBlendFuncFactors("blendFunc", sfactor, dfactor)) |
return; |
- webContext()->blendFunc(sfactor, dfactor); |
+ m_context->blendFunc(sfactor, dfactor); |
} |
void WebGLRenderingContextBase::blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) |
@@ -1137,7 +1139,7 @@ |
// Note: Alpha does not have the same restrictions as RGB. |
if (isContextLost() || !validateBlendFuncFactors("blendFuncSeparate", srcRGB, dstRGB)) |
return; |
- webContext()->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); |
+ m_context->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); |
} |
void WebGLRenderingContextBase::bufferData(GLenum target, long long size, GLenum usage) |
@@ -1156,7 +1158,7 @@ |
return; |
} |
- webContext()->bufferData(target, static_cast<GLsizeiptr>(size), 0, usage); |
+ m_context->bufferData(target, static_cast<GLsizeiptr>(size), 0, usage); |
} |
void WebGLRenderingContextBase::bufferData(GLenum target, ArrayBuffer* data, GLenum usage) |
@@ -1170,7 +1172,7 @@ |
synthesizeGLError(GL_INVALID_VALUE, "bufferData", "no data"); |
return; |
} |
- webContext()->bufferData(target, data->byteLength(), data->data(), usage); |
+ m_context->bufferData(target, data->byteLength(), data->data(), usage); |
} |
void WebGLRenderingContextBase::bufferData(GLenum target, ArrayBufferView* data, GLenum usage) |
@@ -1185,7 +1187,7 @@ |
return; |
} |
- webContext()->bufferData(target, data->byteLength(), data->baseAddress(), usage); |
+ m_context->bufferData(target, data->byteLength(), data->baseAddress(), usage); |
} |
void WebGLRenderingContextBase::bufferSubData(GLenum target, long long offset, ArrayBuffer* data) |
@@ -1202,7 +1204,7 @@ |
if (!data) |
return; |
- webContext()->bufferSubData(target, static_cast<GLintptr>(offset), data->byteLength(), data->data()); |
+ m_context->bufferSubData(target, static_cast<GLintptr>(offset), data->byteLength(), data->data()); |
} |
void WebGLRenderingContextBase::bufferSubData(GLenum target, long long offset, ArrayBufferView* data) |
@@ -1219,7 +1221,7 @@ |
if (!data) |
return; |
- webContext()->bufferSubData(target, static_cast<GLintptr>(offset), data->byteLength(), data->baseAddress()); |
+ m_context->bufferSubData(target, static_cast<GLintptr>(offset), data->byteLength(), data->baseAddress()); |
} |
GLenum WebGLRenderingContextBase::checkFramebufferStatus(GLenum target) |
@@ -1238,7 +1240,7 @@ |
emitGLWarning("checkFramebufferStatus", reason); |
return result; |
} |
- result = webContext()->checkFramebufferStatus(target); |
+ result = m_context->checkFramebufferStatus(target); |
return result; |
} |
@@ -1251,12 +1253,12 @@ |
return; |
} |
const char* reason = "framebuffer incomplete"; |
- if (m_framebufferBinding && !m_framebufferBinding->onAccess(webContext(), &reason)) { |
+ if (m_framebufferBinding && !m_framebufferBinding->onAccess(m_context.get(), &reason)) { |
synthesizeGLError(GL_INVALID_FRAMEBUFFER_OPERATION, "clear", reason); |
return; |
} |
if (!clearIfComposited(mask)) |
- webContext()->clear(mask); |
+ m_context->clear(mask); |
markContextChanged(); |
} |
@@ -1276,7 +1278,7 @@ |
m_clearColor[1] = g; |
m_clearColor[2] = b; |
m_clearColor[3] = a; |
- webContext()->clearColor(r, g, b, a); |
+ m_context->clearColor(r, g, b, a); |
} |
void WebGLRenderingContextBase::clearDepth(GLfloat depth) |
@@ -1284,7 +1286,7 @@ |
if (isContextLost()) |
return; |
m_clearDepth = depth; |
- webContext()->clearDepth(depth); |
+ m_context->clearDepth(depth); |
} |
void WebGLRenderingContextBase::clearStencil(GLint s) |
@@ -1292,7 +1294,7 @@ |
if (isContextLost()) |
return; |
m_clearStencil = s; |
- webContext()->clearStencil(s); |
+ m_context->clearStencil(s); |
} |
void WebGLRenderingContextBase::colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) |
@@ -1303,14 +1305,14 @@ |
m_colorMask[1] = green; |
m_colorMask[2] = blue; |
m_colorMask[3] = alpha; |
- webContext()->colorMask(red, green, blue, alpha); |
+ m_context->colorMask(red, green, blue, alpha); |
} |
void WebGLRenderingContextBase::compileShader(WebGLShader* shader) |
{ |
if (isContextLost() || !validateWebGLObject("compileShader", shader)) |
return; |
- webContext()->compileShader(objectOrZero(shader)); |
+ m_context->compileShader(objectOrZero(shader)); |
} |
void WebGLRenderingContextBase::compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, ArrayBufferView* data) |
@@ -1342,8 +1344,8 @@ |
return; |
} |
} |
- webContext()->compressedTexImage2D(target, level, internalformat, width, height, |
- border, data->byteLength(), data->baseAddress()); |
+ m_context->compressedTexImage2D(target, level, internalformat, width, height, |
+ border, data->byteLength(), data->baseAddress()); |
tex->setLevelInfo(target, level, internalformat, width, height, GL_UNSIGNED_BYTE); |
} |
@@ -1372,8 +1374,8 @@ |
if (!validateCompressedTexSubDimensions("compressedTexSubImage2D", target, level, xoffset, yoffset, width, height, format, tex)) |
return; |
- webContext()->compressedTexSubImage2D(target, level, xoffset, yoffset, |
- width, height, format, data->byteLength(), data->baseAddress()); |
+ m_context->compressedTexSubImage2D(target, level, xoffset, yoffset, |
+ width, height, format, data->byteLength(), data->baseAddress()); |
} |
bool WebGLRenderingContextBase::validateSettableTexFormat(const char* functionName, GLenum format) |
@@ -1405,13 +1407,13 @@ |
return; |
} |
const char* reason = "framebuffer incomplete"; |
- if (m_framebufferBinding && !m_framebufferBinding->onAccess(webContext(), &reason)) { |
+ if (m_framebufferBinding && !m_framebufferBinding->onAccess(m_context.get(), &reason)) { |
synthesizeGLError(GL_INVALID_FRAMEBUFFER_OPERATION, "copyTexImage2D", reason); |
return; |
} |
clearIfComposited(); |
ScopedDrawingBufferBinder binder(m_drawingBuffer.get(), m_framebufferBinding.get()); |
- webContext()->copyTexImage2D(target, level, internalformat, x, y, width, height, border); |
+ m_context->copyTexImage2D(target, level, internalformat, x, y, width, height, border); |
// FIXME: if the framebuffer is not complete, none of the below should be executed. |
tex->setLevelInfo(target, level, internalformat, width, height, GL_UNSIGNED_BYTE); |
} |
@@ -1448,13 +1450,13 @@ |
return; |
} |
const char* reason = "framebuffer incomplete"; |
- if (m_framebufferBinding && !m_framebufferBinding->onAccess(webContext(), &reason)) { |
+ if (m_framebufferBinding && !m_framebufferBinding->onAccess(m_context.get(), &reason)) { |
synthesizeGLError(GL_INVALID_FRAMEBUFFER_OPERATION, "copyTexSubImage2D", reason); |
return; |
} |
clearIfComposited(); |
ScopedDrawingBufferBinder binder(m_drawingBuffer.get(), m_framebufferBinding.get()); |
- webContext()->copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); |
+ m_context->copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); |
} |
PassRefPtr<WebGLBuffer> WebGLRenderingContextBase::createBuffer() |
@@ -1508,8 +1510,8 @@ |
return 0; |
if (!renderbuffer->emulatedStencilBuffer()) { |
renderbuffer->setEmulatedStencilBuffer(createRenderbuffer()); |
- webContext()->bindRenderbuffer(target, objectOrZero(renderbuffer->emulatedStencilBuffer())); |
- webContext()->bindRenderbuffer(target, objectOrZero(m_renderbufferBinding.get())); |
+ m_context->bindRenderbuffer(target, objectOrZero(renderbuffer->emulatedStencilBuffer())); |
+ m_context->bindRenderbuffer(target, objectOrZero(m_renderbufferBinding.get())); |
} |
return renderbuffer->emulatedStencilBuffer(); |
} |
@@ -1541,7 +1543,7 @@ |
synthesizeGLError(GL_INVALID_ENUM, "cullFace", "invalid mode"); |
return; |
} |
- webContext()->cullFace(mode); |
+ m_context->cullFace(mode); |
} |
bool WebGLRenderingContextBase::deleteObject(WebGLObject* object) |
@@ -1555,7 +1557,7 @@ |
if (object->object()) { |
// We need to pass in context here because we want |
// things in this context unbound. |
- object->deleteObject(webContext()); |
+ object->deleteObject(m_context.get()); |
} |
return true; |
} |
@@ -1637,7 +1639,7 @@ |
return; |
if (!validateStencilOrDepthFunc("depthFunc", func)) |
return; |
- webContext()->depthFunc(func); |
+ m_context->depthFunc(func); |
} |
void WebGLRenderingContextBase::depthMask(GLboolean flag) |
@@ -1645,7 +1647,7 @@ |
if (isContextLost()) |
return; |
m_depthMask = flag; |
- webContext()->depthMask(flag); |
+ m_context->depthMask(flag); |
} |
void WebGLRenderingContextBase::depthRange(GLfloat zNear, GLfloat zFar) |
@@ -1656,7 +1658,7 @@ |
synthesizeGLError(GL_INVALID_OPERATION, "depthRange", "zNear > zFar"); |
return; |
} |
- webContext()->depthRange(zNear, zFar); |
+ m_context->depthRange(zNear, zFar); |
} |
void WebGLRenderingContextBase::detachShader(WebGLProgram* program, WebGLShader* shader) |
@@ -1667,8 +1669,8 @@ |
synthesizeGLError(GL_INVALID_OPERATION, "detachShader", "shader not attached"); |
return; |
} |
- webContext()->detachShader(objectOrZero(program), objectOrZero(shader)); |
- shader->onDetached(webContext()); |
+ m_context->detachShader(objectOrZero(program), objectOrZero(shader)); |
+ shader->onDetached(m_context.get()); |
} |
void WebGLRenderingContextBase::disable(GLenum cap) |
@@ -1684,7 +1686,7 @@ |
m_scissorEnabled = false; |
m_drawingBuffer->setScissorEnabled(m_scissorEnabled); |
} |
- webContext()->disable(cap); |
+ m_context->disable(cap); |
} |
void WebGLRenderingContextBase::disableVertexAttribArray(GLuint index) |
@@ -1704,7 +1706,7 @@ |
findNewMaxEnabledAttribIndex(); |
} |
- webContext()->disableVertexAttribArray(index); |
+ m_context->disableVertexAttribArray(index); |
} |
bool WebGLRenderingContextBase::validateRenderingState(const char* functionName) |
@@ -1748,7 +1750,7 @@ |
clearIfComposited(); |
handleTextureCompleteness("drawArrays", true); |
- webContext()->drawArrays(mode, first, count); |
+ m_context->drawArrays(mode, first, count); |
handleTextureCompleteness("drawArrays", false); |
markContextChanged(); |
} |
@@ -1761,7 +1763,7 @@ |
clearIfComposited(); |
handleTextureCompleteness("drawElements", true); |
- webContext()->drawElements(mode, count, type, static_cast<GLintptr>(offset)); |
+ m_context->drawElements(mode, count, type, static_cast<GLintptr>(offset)); |
handleTextureCompleteness("drawElements", false); |
markContextChanged(); |
} |
@@ -1777,7 +1779,7 @@ |
clearIfComposited(); |
handleTextureCompleteness("drawArraysInstancedANGLE", true); |
- webContext()->drawArraysInstancedANGLE(mode, first, count, primcount); |
+ m_context->drawArraysInstancedANGLE(mode, first, count, primcount); |
handleTextureCompleteness("drawArraysInstancedANGLE", false); |
markContextChanged(); |
} |
@@ -1793,7 +1795,7 @@ |
clearIfComposited(); |
handleTextureCompleteness("drawElementsInstancedANGLE", true); |
- webContext()->drawElementsInstancedANGLE(mode, count, type, static_cast<GLintptr>(offset), primcount); |
+ m_context->drawElementsInstancedANGLE(mode, count, type, static_cast<GLintptr>(offset), primcount); |
handleTextureCompleteness("drawElementsInstancedANGLE", false); |
markContextChanged(); |
} |
@@ -1811,7 +1813,7 @@ |
m_scissorEnabled = true; |
m_drawingBuffer->setScissorEnabled(m_scissorEnabled); |
} |
- webContext()->enable(cap); |
+ m_context->enable(cap); |
} |
void WebGLRenderingContextBase::enableVertexAttribArray(GLuint index) |
@@ -1828,21 +1830,21 @@ |
m_onePlusMaxEnabledAttribIndex = max(index + 1, m_onePlusMaxEnabledAttribIndex); |
- webContext()->enableVertexAttribArray(index); |
+ m_context->enableVertexAttribArray(index); |
} |
void WebGLRenderingContextBase::finish() |
{ |
if (isContextLost()) |
return; |
- webContext()->flush(); // Intentionally a flush, not a finish. |
+ m_context->flush(); // Intentionally a flush, not a finish. |
} |
void WebGLRenderingContextBase::flush() |
{ |
if (isContextLost()) |
return; |
- webContext()->flush(); |
+ m_context->flush(); |
} |
void WebGLRenderingContextBase::framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer* buffer) |
@@ -1868,20 +1870,20 @@ |
switch (attachment) { |
case GC3D_DEPTH_STENCIL_ATTACHMENT_WEBGL: |
if (isDepthStencilSupported() || !buffer) { |
- webContext()->framebufferRenderbuffer(target, GL_DEPTH_ATTACHMENT, renderbuffertarget, bufferObject); |
- webContext()->framebufferRenderbuffer(target, GL_STENCIL_ATTACHMENT, renderbuffertarget, bufferObject); |
+ m_context->framebufferRenderbuffer(target, GL_DEPTH_ATTACHMENT, renderbuffertarget, bufferObject); |
+ m_context->framebufferRenderbuffer(target, GL_STENCIL_ATTACHMENT, renderbuffertarget, bufferObject); |
} else { |
WebGLRenderbuffer* emulatedStencilBuffer = ensureEmulatedStencilBuffer(renderbuffertarget, buffer); |
if (!emulatedStencilBuffer) { |
synthesizeGLError(GL_OUT_OF_MEMORY, "framebufferRenderbuffer", "out of memory"); |
return; |
} |
- webContext()->framebufferRenderbuffer(target, GL_DEPTH_ATTACHMENT, renderbuffertarget, bufferObject); |
- webContext()->framebufferRenderbuffer(target, GL_STENCIL_ATTACHMENT, renderbuffertarget, objectOrZero(emulatedStencilBuffer)); |
+ m_context->framebufferRenderbuffer(target, GL_DEPTH_ATTACHMENT, renderbuffertarget, bufferObject); |
+ m_context->framebufferRenderbuffer(target, GL_STENCIL_ATTACHMENT, renderbuffertarget, objectOrZero(emulatedStencilBuffer)); |
} |
break; |
default: |
- webContext()->framebufferRenderbuffer(target, attachment, renderbuffertarget, bufferObject); |
+ m_context->framebufferRenderbuffer(target, attachment, renderbuffertarget, bufferObject); |
} |
m_framebufferBinding->setAttachmentForBoundFramebuffer(attachment, buffer); |
applyStencilTest(); |
@@ -1909,17 +1911,17 @@ |
Platform3DObject textureObject = objectOrZero(texture); |
switch (attachment) { |
case GC3D_DEPTH_STENCIL_ATTACHMENT_WEBGL: |
- webContext()->framebufferTexture2D(target, GL_DEPTH_ATTACHMENT, textarget, textureObject, level); |
- webContext()->framebufferTexture2D(target, GL_STENCIL_ATTACHMENT, textarget, textureObject, level); |
+ m_context->framebufferTexture2D(target, GL_DEPTH_ATTACHMENT, textarget, textureObject, level); |
+ m_context->framebufferTexture2D(target, GL_STENCIL_ATTACHMENT, textarget, textureObject, level); |
break; |
case GL_DEPTH_ATTACHMENT: |
- webContext()->framebufferTexture2D(target, attachment, textarget, textureObject, level); |
+ m_context->framebufferTexture2D(target, attachment, textarget, textureObject, level); |
break; |
case GL_STENCIL_ATTACHMENT: |
- webContext()->framebufferTexture2D(target, attachment, textarget, textureObject, level); |
+ m_context->framebufferTexture2D(target, attachment, textarget, textureObject, level); |
break; |
default: |
- webContext()->framebufferTexture2D(target, attachment, textarget, textureObject, level); |
+ m_context->framebufferTexture2D(target, attachment, textarget, textureObject, level); |
} |
m_framebufferBinding->setAttachmentForBoundFramebuffer(attachment, textarget, texture, level); |
applyStencilTest(); |
@@ -1937,7 +1939,7 @@ |
synthesizeGLError(GL_INVALID_ENUM, "frontFace", "invalid mode"); |
return; |
} |
- webContext()->frontFace(mode); |
+ m_context->frontFace(mode); |
} |
void WebGLRenderingContextBase::generateMipmap(GLenum target) |
@@ -1959,14 +1961,14 @@ |
#if OS(MACOSX) |
bool needToResetMinFilter = false; |
if (tex->getMinFilter() != GL_NEAREST_MIPMAP_LINEAR) { |
- webContext()->texParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR); |
+ m_context->texParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR); |
needToResetMinFilter = true; |
} |
#endif |
- webContext()->generateMipmap(target); |
+ m_context->generateMipmap(target); |
#if OS(MACOSX) |
if (needToResetMinFilter) |
- webContext()->texParameteri(target, GL_TEXTURE_MIN_FILTER, tex->getMinFilter()); |
+ m_context->texParameteri(target, GL_TEXTURE_MIN_FILTER, tex->getMinFilter()); |
#endif |
tex->generateMipmapLevelInfo(); |
} |
@@ -1976,7 +1978,7 @@ |
if (isContextLost() || !validateWebGLObject("getActiveAttrib", program)) |
return nullptr; |
blink::WebGraphicsContext3D::ActiveInfo info; |
- if (!webContext()->getActiveAttrib(objectOrZero(program), index, info)) |
+ if (!m_context->getActiveAttrib(objectOrZero(program), index, info)) |
return nullptr; |
return WebGLActiveInfo::create(info.name, info.type, info.size); |
} |
@@ -1986,7 +1988,7 @@ |
if (isContextLost() || !validateWebGLObject("getActiveUniform", program)) |
return nullptr; |
blink::WebGraphicsContext3D::ActiveInfo info; |
- if (!webContext()->getActiveUniform(objectOrZero(program), index, info)) |
+ if (!m_context->getActiveUniform(objectOrZero(program), index, info)) |
return nullptr; |
return WebGLActiveInfo::create(info.name, info.type, info.size); |
} |
@@ -2023,7 +2025,7 @@ |
synthesizeGLError(GL_INVALID_OPERATION, "getAttribLocation", "program not linked"); |
return 0; |
} |
- return webContext()->getAttribLocation(objectOrZero(program), name.utf8().data()); |
+ return m_context->getAttribLocation(objectOrZero(program), name.utf8().data()); |
} |
WebGLGetInfo WebGLRenderingContextBase::getBufferParameter(GLenum target, GLenum pname) |
@@ -2041,7 +2043,7 @@ |
} |
GLint value = 0; |
- webContext()->getBufferParameteriv(target, pname, &value); |
+ m_context->getBufferParameteriv(target, pname, &value); |
if (pname == GL_BUFFER_SIZE) |
return WebGLGetInfo(value); |
return WebGLGetInfo(static_cast<unsigned>(value)); |
@@ -2053,7 +2055,7 @@ |
return nullptr; |
// We always need to return a new WebGLContextAttributes object to |
// prevent the user from mutating any cached version. |
- blink::WebGraphicsContext3D::Attributes attrs = webContext()->getContextAttributes(); |
+ blink::WebGraphicsContext3D::Attributes attrs = m_context->getContextAttributes(); |
RefPtr<WebGLContextAttributes> attributes = m_requestedAttributes->clone(); |
// Some requested attributes may not be honored, so we need to query the underlying |
// context/drawing buffer and adjust accordingly. |
@@ -2076,7 +2078,7 @@ |
if (isContextLost()) |
return GL_NO_ERROR; |
- return webContext()->getError(); |
+ return m_context->getError(); |
} |
bool WebGLRenderingContextBase::ExtensionTracker::matchesNameWithPrefixes(const String& name) const |
@@ -2151,7 +2153,7 @@ |
case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: |
{ |
GLint value = 0; |
- webContext()->getFramebufferAttachmentParameteriv(target, attachment, pname, &value); |
+ m_context->getFramebufferAttachmentParameteriv(target, attachment, pname, &value); |
return WebGLGetInfo(value); |
} |
default: |
@@ -2297,7 +2299,7 @@ |
case GL_SCISSOR_TEST: |
return getBooleanParameter(pname); |
case GL_SHADING_LANGUAGE_VERSION: |
- return WebGLGetInfo("WebGL GLSL ES 1.0 (" + String(webContext()->getString(GL_SHADING_LANGUAGE_VERSION)) + ")"); |
+ return WebGLGetInfo("WebGL GLSL ES 1.0 (" + String(m_context->getString(GL_SHADING_LANGUAGE_VERSION)) + ")"); |
case GL_STENCIL_BACK_FAIL: |
return getUnsignedIntParameter(pname); |
case GL_STENCIL_BACK_FUNC: |
@@ -2351,7 +2353,7 @@ |
case GL_VENDOR: |
return WebGLGetInfo(String("WebKit")); |
case GL_VERSION: |
- return WebGLGetInfo("WebGL 1.0 (" + String(webContext()->getString(GL_VERSION)) + ")"); |
+ return WebGLGetInfo("WebGL 1.0 (" + String(m_context->getString(GL_VERSION)) + ")"); |
case GL_VIEWPORT: |
return getWebGLIntArrayParameter(pname); |
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: // OES_standard_derivatives |
@@ -2361,12 +2363,12 @@ |
return WebGLGetInfo(); |
case WebGLDebugRendererInfo::UNMASKED_RENDERER_WEBGL: |
if (extensionEnabled(WebGLDebugRendererInfoName)) |
- return WebGLGetInfo(webContext()->getString(GL_RENDERER)); |
+ return WebGLGetInfo(m_context->getString(GL_RENDERER)); |
synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled"); |
return WebGLGetInfo(); |
case WebGLDebugRendererInfo::UNMASKED_VENDOR_WEBGL: |
if (extensionEnabled(WebGLDebugRendererInfoName)) |
- return WebGLGetInfo(webContext()->getString(GL_VENDOR)); |
+ return WebGLGetInfo(m_context->getString(GL_VENDOR)); |
synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled"); |
return WebGLGetInfo(); |
case GL_VERTEX_ARRAY_BINDING_OES: // OES_vertex_array_object |
@@ -2418,14 +2420,14 @@ |
case GL_DELETE_STATUS: |
return WebGLGetInfo(program->isDeleted()); |
case GL_VALIDATE_STATUS: |
- webContext()->getProgramiv(objectOrZero(program), pname, &value); |
+ m_context->getProgramiv(objectOrZero(program), pname, &value); |
return WebGLGetInfo(static_cast<bool>(value)); |
case GL_LINK_STATUS: |
return WebGLGetInfo(program->linkStatus()); |
case GL_ATTACHED_SHADERS: |
case GL_ACTIVE_ATTRIBUTES: |
case GL_ACTIVE_UNIFORMS: |
- webContext()->getProgramiv(objectOrZero(program), pname, &value); |
+ m_context->getProgramiv(objectOrZero(program), pname, &value); |
return WebGLGetInfo(value); |
default: |
synthesizeGLError(GL_INVALID_ENUM, "getProgramParameter", "invalid parameter name"); |
@@ -2439,7 +2441,7 @@ |
return String(); |
if (!validateWebGLObject("getProgramInfoLog", program)) |
return ""; |
- return ensureNotNull(webContext()->getProgramInfoLog(objectOrZero(program))); |
+ return ensureNotNull(m_context->getProgramInfoLog(objectOrZero(program))); |
} |
WebGLGetInfo WebGLRenderingContextBase::getRenderbufferParameter(GLenum target, GLenum pname) |
@@ -2464,15 +2466,15 @@ |
case GL_RENDERBUFFER_BLUE_SIZE: |
case GL_RENDERBUFFER_ALPHA_SIZE: |
case GL_RENDERBUFFER_DEPTH_SIZE: |
- webContext()->getRenderbufferParameteriv(target, pname, &value); |
+ m_context->getRenderbufferParameteriv(target, pname, &value); |
return WebGLGetInfo(value); |
case GL_RENDERBUFFER_STENCIL_SIZE: |
if (m_renderbufferBinding->emulatedStencilBuffer()) { |
- webContext()->bindRenderbuffer(target, objectOrZero(m_renderbufferBinding->emulatedStencilBuffer())); |
- webContext()->getRenderbufferParameteriv(target, pname, &value); |
- webContext()->bindRenderbuffer(target, objectOrZero(m_renderbufferBinding.get())); |
+ m_context->bindRenderbuffer(target, objectOrZero(m_renderbufferBinding->emulatedStencilBuffer())); |
+ m_context->getRenderbufferParameteriv(target, pname, &value); |
+ m_context->bindRenderbuffer(target, objectOrZero(m_renderbufferBinding.get())); |
} else { |
- webContext()->getRenderbufferParameteriv(target, pname, &value); |
+ m_context->getRenderbufferParameteriv(target, pname, &value); |
} |
return WebGLGetInfo(value); |
case GL_RENDERBUFFER_INTERNAL_FORMAT: |
@@ -2492,10 +2494,10 @@ |
case GL_DELETE_STATUS: |
return WebGLGetInfo(shader->isDeleted()); |
case GL_COMPILE_STATUS: |
- webContext()->getShaderiv(objectOrZero(shader), pname, &value); |
+ m_context->getShaderiv(objectOrZero(shader), pname, &value); |
return WebGLGetInfo(static_cast<bool>(value)); |
case GL_SHADER_TYPE: |
- webContext()->getShaderiv(objectOrZero(shader), pname, &value); |
+ m_context->getShaderiv(objectOrZero(shader), pname, &value); |
return WebGLGetInfo(static_cast<unsigned>(value)); |
default: |
synthesizeGLError(GL_INVALID_ENUM, "getShaderParameter", "invalid parameter name"); |
@@ -2509,7 +2511,7 @@ |
return String(); |
if (!validateWebGLObject("getShaderInfoLog", shader)) |
return ""; |
- return ensureNotNull(webContext()->getShaderInfoLog(objectOrZero(shader))); |
+ return ensureNotNull(m_context->getShaderInfoLog(objectOrZero(shader))); |
} |
PassRefPtr<WebGLShaderPrecisionFormat> WebGLRenderingContextBase::getShaderPrecisionFormat(GLenum shaderType, GLenum precisionType) |
@@ -2539,7 +2541,7 @@ |
GLint range[2] = {0, 0}; |
GLint precision = 0; |
- webContext()->getShaderPrecisionFormat(shaderType, precisionType, range, &precision); |
+ m_context->getShaderPrecisionFormat(shaderType, precisionType, range, &precision); |
return WebGLShaderPrecisionFormat::create(range[0], range[1], precision); |
} |
@@ -2586,11 +2588,11 @@ |
case GL_TEXTURE_MIN_FILTER: |
case GL_TEXTURE_WRAP_S: |
case GL_TEXTURE_WRAP_T: |
- webContext()->getTexParameteriv(target, pname, &value); |
+ m_context->getTexParameteriv(target, pname, &value); |
return WebGLGetInfo(static_cast<unsigned>(value)); |
case GL_TEXTURE_MAX_ANISOTROPY_EXT: // EXT_texture_filter_anisotropic |
if (extensionEnabled(EXTTextureFilterAnisotropicName)) { |
- webContext()->getTexParameteriv(target, pname, &value); |
+ m_context->getTexParameteriv(target, pname, &value); |
return WebGLGetInfo(static_cast<unsigned>(value)); |
} |
synthesizeGLError(GL_INVALID_ENUM, "getTexParameter", "invalid parameter name, EXT_texture_filter_anisotropic not enabled"); |
@@ -2613,10 +2615,10 @@ |
// FIXME: make this more efficient using WebGLUniformLocation and caching types in it |
GLint activeUniforms = 0; |
- webContext()->getProgramiv(objectOrZero(program), GL_ACTIVE_UNIFORMS, &activeUniforms); |
+ m_context->getProgramiv(objectOrZero(program), GL_ACTIVE_UNIFORMS, &activeUniforms); |
for (GLint i = 0; i < activeUniforms; i++) { |
blink::WebGraphicsContext3D::ActiveInfo info; |
- if (!webContext()->getActiveUniform(objectOrZero(program), i, info)) |
+ if (!m_context->getActiveUniform(objectOrZero(program), i, info)) |
return WebGLGetInfo(); |
String name = info.name; |
StringBuilder nameBuilder; |
@@ -2633,7 +2635,7 @@ |
nameBuilder.append(']'); |
} |
// Now need to look this up by name again to find its location |
- GLint loc = webContext()->getUniformLocation(objectOrZero(program), nameBuilder.toString().utf8().data()); |
+ GLint loc = m_context->getUniformLocation(objectOrZero(program), nameBuilder.toString().utf8().data()); |
if (loc == location) { |
// Found it. Use the type in the ActiveInfo to determine the return type. |
GLenum baseType; |
@@ -2712,21 +2714,21 @@ |
switch (baseType) { |
case GL_FLOAT: { |
GLfloat value[16] = {0}; |
- webContext()->getUniformfv(objectOrZero(program), location, value); |
+ m_context->getUniformfv(objectOrZero(program), location, value); |
if (length == 1) |
return WebGLGetInfo(value[0]); |
return WebGLGetInfo(Float32Array::create(value, length)); |
} |
case GL_INT: { |
GLint value[4] = {0}; |
- webContext()->getUniformiv(objectOrZero(program), location, value); |
+ m_context->getUniformiv(objectOrZero(program), location, value); |
if (length == 1) |
return WebGLGetInfo(value[0]); |
return WebGLGetInfo(Int32Array::create(value, length)); |
} |
case GL_BOOL: { |
GLint value[4] = {0}; |
- webContext()->getUniformiv(objectOrZero(program), location, value); |
+ m_context->getUniformiv(objectOrZero(program), location, value); |
if (length > 1) { |
bool boolValue[16] = {0}; |
for (unsigned j = 0; j < length; j++) |
@@ -2760,7 +2762,7 @@ |
synthesizeGLError(GL_INVALID_OPERATION, "getUniformLocation", "program not linked"); |
return nullptr; |
} |
- GLint uniformLocation = webContext()->getUniformLocation(objectOrZero(program), name.utf8().data()); |
+ GLint uniformLocation = m_context->getUniformLocation(objectOrZero(program), name.utf8().data()); |
if (uniformLocation == -1) |
return nullptr; |
return WebGLUniformLocation::create(program, uniformLocation); |
@@ -2810,7 +2812,7 @@ |
synthesizeGLError(GL_INVALID_ENUM, "getVertexAttribOffset", "invalid parameter name"); |
return 0; |
} |
- GLsizeiptr result = webContext()->getVertexAttribOffset(index, pname); |
+ GLsizeiptr result = m_context->getVertexAttribOffset(index, pname); |
return static_cast<long long>(result); |
} |
@@ -2832,7 +2834,7 @@ |
synthesizeGLError(GL_INVALID_ENUM, "hint", "invalid target"); |
return; |
} |
- webContext()->hint(target, mode); |
+ m_context->hint(target, mode); |
} |
GLboolean WebGLRenderingContextBase::isBuffer(WebGLBuffer* buffer) |
@@ -2843,10 +2845,10 @@ |
if (!buffer->hasEverBeenBound()) |
return 0; |
- return webContext()->isBuffer(buffer->object()); |
+ return m_context->isBuffer(buffer->object()); |
} |
-bool WebGLRenderingContextBase::isContextLost() const |
+bool WebGLRenderingContextBase::isContextLost() |
{ |
return m_contextLost; |
} |
@@ -2857,7 +2859,7 @@ |
return 0; |
if (cap == GL_STENCIL_TEST) |
return m_stencilEnabled; |
- return webContext()->isEnabled(cap); |
+ return m_context->isEnabled(cap); |
} |
GLboolean WebGLRenderingContextBase::isFramebuffer(WebGLFramebuffer* framebuffer) |
@@ -2868,7 +2870,7 @@ |
if (!framebuffer->hasEverBeenBound()) |
return 0; |
- return webContext()->isFramebuffer(framebuffer->object()); |
+ return m_context->isFramebuffer(framebuffer->object()); |
} |
GLboolean WebGLRenderingContextBase::isProgram(WebGLProgram* program) |
@@ -2876,7 +2878,7 @@ |
if (!program || isContextLost()) |
return 0; |
- return webContext()->isProgram(program->object()); |
+ return m_context->isProgram(program->object()); |
} |
GLboolean WebGLRenderingContextBase::isRenderbuffer(WebGLRenderbuffer* renderbuffer) |
@@ -2887,7 +2889,7 @@ |
if (!renderbuffer->hasEverBeenBound()) |
return 0; |
- return webContext()->isRenderbuffer(renderbuffer->object()); |
+ return m_context->isRenderbuffer(renderbuffer->object()); |
} |
GLboolean WebGLRenderingContextBase::isShader(WebGLShader* shader) |
@@ -2895,7 +2897,7 @@ |
if (!shader || isContextLost()) |
return 0; |
- return webContext()->isShader(shader->object()); |
+ return m_context->isShader(shader->object()); |
} |
GLboolean WebGLRenderingContextBase::isTexture(WebGLTexture* texture) |
@@ -2906,14 +2908,14 @@ |
if (!texture->hasEverBeenBound()) |
return 0; |
- return webContext()->isTexture(texture->object()); |
+ return m_context->isTexture(texture->object()); |
} |
void WebGLRenderingContextBase::lineWidth(GLfloat width) |
{ |
if (isContextLost()) |
return; |
- webContext()->lineWidth(width); |
+ m_context->lineWidth(width); |
} |
void WebGLRenderingContextBase::linkProgram(WebGLProgram* program) |
@@ -2921,7 +2923,7 @@ |
if (isContextLost() || !validateWebGLObject("linkProgram", program)) |
return; |
- webContext()->linkProgram(objectOrZero(program)); |
+ m_context->linkProgram(objectOrZero(program)); |
program->increaseLinkCount(); |
} |
@@ -2953,7 +2955,7 @@ |
} else { // GL_UNPACK_ALIGNMENT: |
m_unpackAlignment = param; |
} |
- webContext()->pixelStorei(pname, param); |
+ m_context->pixelStorei(pname, param); |
} else { |
synthesizeGLError(GL_INVALID_VALUE, "pixelStorei", "invalid parameter for alignment"); |
return; |
@@ -2969,7 +2971,7 @@ |
{ |
if (isContextLost()) |
return; |
- webContext()->polygonOffset(factor, units); |
+ m_context->polygonOffset(factor, units); |
} |
void WebGLRenderingContextBase::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView* pixels) |
@@ -3013,7 +3015,7 @@ |
return; |
} |
const char* reason = "framebuffer incomplete"; |
- if (m_framebufferBinding && !m_framebufferBinding->onAccess(webContext(), &reason)) { |
+ if (m_framebufferBinding && !m_framebufferBinding->onAccess(m_context.get(), &reason)) { |
synthesizeGLError(GL_INVALID_FRAMEBUFFER_OPERATION, "readPixels", reason); |
return; |
} |
@@ -3035,13 +3037,13 @@ |
{ |
ScopedDrawingBufferBinder binder(m_drawingBuffer.get(), m_framebufferBinding.get()); |
- webContext()->readPixels(x, y, width, height, format, type, data); |
+ m_context->readPixels(x, y, width, height, format, type, data); |
} |
#if OS(MACOSX) |
// FIXME: remove this section when GL driver bug on Mac is fixed, i.e., |
// when alpha is off, readPixels should set alpha to 255 instead of 0. |
- if (!m_framebufferBinding && !webContext()->getContextAttributes().alpha) { |
+ if (!m_framebufferBinding && !m_context->getContextAttributes().alpha) { |
unsigned char* pixels = reinterpret_cast<unsigned char*>(data); |
for (GLsizei iy = 0; iy < height; ++iy) { |
for (GLsizei ix = 0; ix < width; ++ix) { |
@@ -3074,24 +3076,24 @@ |
case GL_RGB5_A1: |
case GL_RGB565: |
case GL_STENCIL_INDEX8: |
- webContext()->renderbufferStorage(target, internalformat, width, height); |
+ m_context->renderbufferStorage(target, internalformat, width, height); |
m_renderbufferBinding->setInternalFormat(internalformat); |
m_renderbufferBinding->setSize(width, height); |
- m_renderbufferBinding->deleteEmulatedStencilBuffer(webContext()); |
+ m_renderbufferBinding->deleteEmulatedStencilBuffer(m_context.get()); |
break; |
case GL_DEPTH_STENCIL_OES: |
if (isDepthStencilSupported()) { |
- webContext()->renderbufferStorage(target, GL_DEPTH24_STENCIL8_OES, width, height); |
+ m_context->renderbufferStorage(target, GL_DEPTH24_STENCIL8_OES, width, height); |
} else { |
WebGLRenderbuffer* emulatedStencilBuffer = ensureEmulatedStencilBuffer(target, m_renderbufferBinding.get()); |
if (!emulatedStencilBuffer) { |
synthesizeGLError(GL_OUT_OF_MEMORY, "renderbufferStorage", "out of memory"); |
return; |
} |
- webContext()->renderbufferStorage(target, GL_DEPTH_COMPONENT16, width, height); |
- webContext()->bindRenderbuffer(target, objectOrZero(emulatedStencilBuffer)); |
- webContext()->renderbufferStorage(target, GL_STENCIL_INDEX8, width, height); |
- webContext()->bindRenderbuffer(target, objectOrZero(m_renderbufferBinding.get())); |
+ m_context->renderbufferStorage(target, GL_DEPTH_COMPONENT16, width, height); |
+ m_context->bindRenderbuffer(target, objectOrZero(emulatedStencilBuffer)); |
+ m_context->renderbufferStorage(target, GL_STENCIL_INDEX8, width, height); |
+ m_context->bindRenderbuffer(target, objectOrZero(m_renderbufferBinding.get())); |
emulatedStencilBuffer->setSize(width, height); |
emulatedStencilBuffer->setInternalFormat(GL_STENCIL_INDEX8); |
} |
@@ -3109,7 +3111,7 @@ |
{ |
if (isContextLost()) |
return; |
- webContext()->sampleCoverage(value, invert); |
+ m_context->sampleCoverage(value, invert); |
} |
void WebGLRenderingContextBase::scissor(GLint x, GLint y, GLsizei width, GLsizei height) |
@@ -3118,7 +3120,7 @@ |
return; |
if (!validateSize("scissor", width, height)) |
return; |
- webContext()->scissor(x, y, width, height); |
+ m_context->scissor(x, y, width, height); |
} |
void WebGLRenderingContextBase::shaderSource(WebGLShader* shader, const String& string) |
@@ -3129,7 +3131,7 @@ |
if (!validateString("shaderSource", stringWithoutComments)) |
return; |
shader->setSource(string); |
- webContext()->shaderSource(objectOrZero(shader), stringWithoutComments.utf8().data()); |
+ m_context->shaderSource(objectOrZero(shader), stringWithoutComments.utf8().data()); |
} |
void WebGLRenderingContextBase::stencilFunc(GLenum func, GLint ref, GLuint mask) |
@@ -3142,7 +3144,7 @@ |
m_stencilFuncRefBack = ref; |
m_stencilFuncMask = mask; |
m_stencilFuncMaskBack = mask; |
- webContext()->stencilFunc(func, ref, mask); |
+ m_context->stencilFunc(func, ref, mask); |
} |
void WebGLRenderingContextBase::stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) |
@@ -3170,7 +3172,7 @@ |
synthesizeGLError(GL_INVALID_ENUM, "stencilFuncSeparate", "invalid face"); |
return; |
} |
- webContext()->stencilFuncSeparate(face, func, ref, mask); |
+ m_context->stencilFuncSeparate(face, func, ref, mask); |
} |
void WebGLRenderingContextBase::stencilMask(GLuint mask) |
@@ -3179,7 +3181,7 @@ |
return; |
m_stencilMask = mask; |
m_stencilMaskBack = mask; |
- webContext()->stencilMask(mask); |
+ m_context->stencilMask(mask); |
} |
void WebGLRenderingContextBase::stencilMaskSeparate(GLenum face, GLuint mask) |
@@ -3201,21 +3203,21 @@ |
synthesizeGLError(GL_INVALID_ENUM, "stencilMaskSeparate", "invalid face"); |
return; |
} |
- webContext()->stencilMaskSeparate(face, mask); |
+ m_context->stencilMaskSeparate(face, mask); |
} |
void WebGLRenderingContextBase::stencilOp(GLenum fail, GLenum zfail, GLenum zpass) |
{ |
if (isContextLost()) |
return; |
- webContext()->stencilOp(fail, zfail, zpass); |
+ m_context->stencilOp(fail, zfail, zpass); |
} |
void WebGLRenderingContextBase::stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) |
{ |
if (isContextLost()) |
return; |
- webContext()->stencilOpSeparate(face, fail, zfail, zpass); |
+ m_context->stencilOpSeparate(face, fail, zfail, zpass); |
} |
GLenum WebGLRenderingContextBase::convertTexInternalFormat(GLenum internalformat, GLenum type) |
@@ -3239,7 +3241,7 @@ |
ASSERT(tex); |
ASSERT(!level || !WebGLTexture::isNPOT(width, height)); |
ASSERT(!pixels || validateSettableTexFormat("texImage2D", internalformat)); |
- webContext()->texImage2D(target, level, convertTexInternalFormat(internalformat, type), width, height, border, format, type, pixels); |
+ m_context->texImage2D(target, level, convertTexInternalFormat(internalformat, type), width, height, border, format, type, pixels); |
tex->setLevelInfo(target, level, internalformat, width, height, type); |
} |
@@ -3267,10 +3269,10 @@ |
} |
if (m_unpackAlignment != 1) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
texImage2DBase(target, level, internalformat, image->width(), image->height(), 0, format, type, needConversion ? data.data() : imagePixelData, exceptionState); |
if (m_unpackAlignment != 1) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
} |
bool WebGLRenderingContextBase::validateTexFunc(const char* functionName, TexFuncValidationFunctionType functionType, TexFuncValidationSourceType sourceType, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLint xoffset, GLint yoffset) |
@@ -3348,10 +3350,10 @@ |
changeUnpackAlignment = true; |
} |
if (changeUnpackAlignment) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
texImage2DBase(target, level, internalformat, width, height, border, format, type, data, exceptionState); |
if (changeUnpackAlignment) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
} |
void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum internalformat, |
@@ -3372,10 +3374,10 @@ |
} |
} |
if (m_unpackAlignment != 1) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
texImage2DBase(target, level, internalformat, pixels->width(), pixels->height(), 0, format, type, needConversion ? data.data() : pixels->data()->data(), exceptionState); |
if (m_unpackAlignment != 1) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
} |
void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum internalformat, |
@@ -3406,14 +3408,14 @@ |
if (GL_TEXTURE_2D == target && texture) { |
if (!canvas->is3D()) { |
ImageBuffer* buffer = canvas->buffer(); |
- if (buffer && buffer->copyToPlatformTexture(webContext(), texture->object(), internalformat, type, |
+ if (buffer && buffer->copyToPlatformTexture(m_context.get(), texture->object(), internalformat, type, |
level, m_unpackPremultiplyAlpha, m_unpackFlipY)) { |
texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas->height(), type); |
return; |
} |
} else { |
WebGLRenderingContextBase* gl = toWebGLRenderingContextBase(canvas->renderingContext()); |
- if (gl && gl->m_drawingBuffer->copyToPlatformTexture(webContext(), texture->object(), internalformat, type, |
+ if (gl && gl->m_drawingBuffer->copyToPlatformTexture(m_context.get(), texture->object(), internalformat, type, |
level, m_unpackPremultiplyAlpha, m_unpackFlipY)) { |
texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas->height(), type); |
return; |
@@ -3453,7 +3455,7 @@ |
// Otherwise, it will fall back to the normal SW path. |
WebGLTexture* texture = validateTextureBinding("texImage2D", target, true); |
if (GL_TEXTURE_2D == target && texture) { |
- if (video->copyVideoTextureToPlatformTexture(webContext(), texture->object(), level, type, internalformat, m_unpackPremultiplyAlpha, m_unpackFlipY)) { |
+ if (video->copyVideoTextureToPlatformTexture(m_context.get(), texture->object(), level, type, internalformat, m_unpackPremultiplyAlpha, m_unpackFlipY)) { |
texture->setLevelInfo(target, level, internalformat, video->videoWidth(), video->videoHeight(), type); |
return; |
} |
@@ -3497,10 +3499,10 @@ |
} |
if (isFloat) { |
tex->setParameterf(pname, paramf); |
- webContext()->texParameterf(target, pname, paramf); |
+ m_context->texParameterf(target, pname, paramf); |
} else { |
tex->setParameteri(pname, parami); |
- webContext()->texParameteri(target, pname, parami); |
+ m_context->texParameteri(target, pname, parami); |
} |
} |
@@ -3532,7 +3534,7 @@ |
ASSERT(tex->getHeight(target, level) >= (yoffset + height)); |
ASSERT(tex->getInternalFormat(target, level) == format); |
ASSERT(tex->getType(target, level) == type); |
- webContext()->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); |
+ m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); |
} |
void WebGLRenderingContextBase::texSubImage2DImpl(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, Image* image, WebGLImageConversion::ImageHtmlDomSource domSource, bool flipY, bool premultiplyAlpha, ExceptionState& exceptionState) |
@@ -3559,10 +3561,10 @@ |
} |
if (m_unpackAlignment != 1) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
texSubImage2DBase(target, level, xoffset, yoffset, image->width(), image->height(), format, type, needConversion ? data.data() : imagePixelData, exceptionState); |
if (m_unpackAlignment != 1) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
} |
void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
@@ -3586,10 +3588,10 @@ |
changeUnpackAlignment = true; |
} |
if (changeUnpackAlignment) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
texSubImage2DBase(target, level, xoffset, yoffset, width, height, format, type, data, exceptionState); |
if (changeUnpackAlignment) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
} |
void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
@@ -3611,10 +3613,10 @@ |
} |
} |
if (m_unpackAlignment != 1) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
texSubImage2DBase(target, level, xoffset, yoffset, pixels->width(), pixels->height(), format, type, needConversion ? data.data() : pixels->data()->data(), exceptionState); |
if (m_unpackAlignment != 1) |
- webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
+ m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
} |
void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
@@ -3670,7 +3672,7 @@ |
return; |
} |
- webContext()->uniform1f(location->location(), x); |
+ m_context->uniform1f(location->location(), x); |
} |
void WebGLRenderingContextBase::uniform1fv(const WebGLUniformLocation* location, Float32Array* v) |
@@ -3678,7 +3680,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform1fv", location, v, 1)) |
return; |
- webContext()->uniform1fv(location->location(), v->length(), v->data()); |
+ m_context->uniform1fv(location->location(), v->length(), v->data()); |
} |
void WebGLRenderingContextBase::uniform1fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size) |
@@ -3686,7 +3688,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform1fv", location, v, size, 1)) |
return; |
- webContext()->uniform1fv(location->location(), size, v); |
+ m_context->uniform1fv(location->location(), size, v); |
} |
void WebGLRenderingContextBase::uniform1i(const WebGLUniformLocation* location, GLint x) |
@@ -3699,7 +3701,7 @@ |
return; |
} |
- webContext()->uniform1i(location->location(), x); |
+ m_context->uniform1i(location->location(), x); |
} |
void WebGLRenderingContextBase::uniform1iv(const WebGLUniformLocation* location, Int32Array* v) |
@@ -3707,7 +3709,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform1iv", location, v, 1)) |
return; |
- webContext()->uniform1iv(location->location(), v->length(), v->data()); |
+ m_context->uniform1iv(location->location(), v->length(), v->data()); |
} |
void WebGLRenderingContextBase::uniform1iv(const WebGLUniformLocation* location, GLint* v, GLsizei size) |
@@ -3715,7 +3717,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform1iv", location, v, size, 1)) |
return; |
- webContext()->uniform1iv(location->location(), size, v); |
+ m_context->uniform1iv(location->location(), size, v); |
} |
void WebGLRenderingContextBase::uniform2f(const WebGLUniformLocation* location, GLfloat x, GLfloat y) |
@@ -3728,7 +3730,7 @@ |
return; |
} |
- webContext()->uniform2f(location->location(), x, y); |
+ m_context->uniform2f(location->location(), x, y); |
} |
void WebGLRenderingContextBase::uniform2fv(const WebGLUniformLocation* location, Float32Array* v) |
@@ -3736,7 +3738,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform2fv", location, v, 2)) |
return; |
- webContext()->uniform2fv(location->location(), v->length() / 2, v->data()); |
+ m_context->uniform2fv(location->location(), v->length() / 2, v->data()); |
} |
void WebGLRenderingContextBase::uniform2fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size) |
@@ -3744,7 +3746,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform2fv", location, v, size, 2)) |
return; |
- webContext()->uniform2fv(location->location(), size / 2, v); |
+ m_context->uniform2fv(location->location(), size / 2, v); |
} |
void WebGLRenderingContextBase::uniform2i(const WebGLUniformLocation* location, GLint x, GLint y) |
@@ -3757,7 +3759,7 @@ |
return; |
} |
- webContext()->uniform2i(location->location(), x, y); |
+ m_context->uniform2i(location->location(), x, y); |
} |
void WebGLRenderingContextBase::uniform2iv(const WebGLUniformLocation* location, Int32Array* v) |
@@ -3765,7 +3767,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform2iv", location, v, 2)) |
return; |
- webContext()->uniform2iv(location->location(), v->length() / 2, v->data()); |
+ m_context->uniform2iv(location->location(), v->length() / 2, v->data()); |
} |
void WebGLRenderingContextBase::uniform2iv(const WebGLUniformLocation* location, GLint* v, GLsizei size) |
@@ -3773,7 +3775,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform2iv", location, v, size, 2)) |
return; |
- webContext()->uniform2iv(location->location(), size / 2, v); |
+ m_context->uniform2iv(location->location(), size / 2, v); |
} |
void WebGLRenderingContextBase::uniform3f(const WebGLUniformLocation* location, GLfloat x, GLfloat y, GLfloat z) |
@@ -3786,7 +3788,7 @@ |
return; |
} |
- webContext()->uniform3f(location->location(), x, y, z); |
+ m_context->uniform3f(location->location(), x, y, z); |
} |
void WebGLRenderingContextBase::uniform3fv(const WebGLUniformLocation* location, Float32Array* v) |
@@ -3794,7 +3796,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform3fv", location, v, 3)) |
return; |
- webContext()->uniform3fv(location->location(), v->length() / 3, v->data()); |
+ m_context->uniform3fv(location->location(), v->length() / 3, v->data()); |
} |
void WebGLRenderingContextBase::uniform3fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size) |
@@ -3802,7 +3804,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform3fv", location, v, size, 3)) |
return; |
- webContext()->uniform3fv(location->location(), size / 3, v); |
+ m_context->uniform3fv(location->location(), size / 3, v); |
} |
void WebGLRenderingContextBase::uniform3i(const WebGLUniformLocation* location, GLint x, GLint y, GLint z) |
@@ -3815,7 +3817,7 @@ |
return; |
} |
- webContext()->uniform3i(location->location(), x, y, z); |
+ m_context->uniform3i(location->location(), x, y, z); |
} |
void WebGLRenderingContextBase::uniform3iv(const WebGLUniformLocation* location, Int32Array* v) |
@@ -3823,7 +3825,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform3iv", location, v, 3)) |
return; |
- webContext()->uniform3iv(location->location(), v->length() / 3, v->data()); |
+ m_context->uniform3iv(location->location(), v->length() / 3, v->data()); |
} |
void WebGLRenderingContextBase::uniform3iv(const WebGLUniformLocation* location, GLint* v, GLsizei size) |
@@ -3831,7 +3833,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform3iv", location, v, size, 3)) |
return; |
- webContext()->uniform3iv(location->location(), size / 3, v); |
+ m_context->uniform3iv(location->location(), size / 3, v); |
} |
void WebGLRenderingContextBase::uniform4f(const WebGLUniformLocation* location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) |
@@ -3844,7 +3846,7 @@ |
return; |
} |
- webContext()->uniform4f(location->location(), x, y, z, w); |
+ m_context->uniform4f(location->location(), x, y, z, w); |
} |
void WebGLRenderingContextBase::uniform4fv(const WebGLUniformLocation* location, Float32Array* v) |
@@ -3852,7 +3854,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform4fv", location, v, 4)) |
return; |
- webContext()->uniform4fv(location->location(), v->length() / 4, v->data()); |
+ m_context->uniform4fv(location->location(), v->length() / 4, v->data()); |
} |
void WebGLRenderingContextBase::uniform4fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size) |
@@ -3860,7 +3862,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform4fv", location, v, size, 4)) |
return; |
- webContext()->uniform4fv(location->location(), size / 4, v); |
+ m_context->uniform4fv(location->location(), size / 4, v); |
} |
void WebGLRenderingContextBase::uniform4i(const WebGLUniformLocation* location, GLint x, GLint y, GLint z, GLint w) |
@@ -3873,7 +3875,7 @@ |
return; |
} |
- webContext()->uniform4i(location->location(), x, y, z, w); |
+ m_context->uniform4i(location->location(), x, y, z, w); |
} |
void WebGLRenderingContextBase::uniform4iv(const WebGLUniformLocation* location, Int32Array* v) |
@@ -3881,7 +3883,7 @@ |
if (isContextLost() || !validateUniformParameters("uniform4iv", location, v, 4)) |
return; |
- webContext()->uniform4iv(location->location(), v->length() / 4, v->data()); |
+ m_context->uniform4iv(location->location(), v->length() / 4, v->data()); |
} |
void WebGLRenderingContextBase::uniform4iv(const WebGLUniformLocation* location, GLint* v, GLsizei size) |
@@ -3889,49 +3891,49 @@ |
if (isContextLost() || !validateUniformParameters("uniform4iv", location, v, size, 4)) |
return; |
- webContext()->uniform4iv(location->location(), size / 4, v); |
+ m_context->uniform4iv(location->location(), size / 4, v); |
} |
void WebGLRenderingContextBase::uniformMatrix2fv(const WebGLUniformLocation* location, GLboolean transpose, Float32Array* v) |
{ |
if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, v, 4)) |
return; |
- webContext()->uniformMatrix2fv(location->location(), v->length() / 4, transpose, v->data()); |
+ m_context->uniformMatrix2fv(location->location(), v->length() / 4, transpose, v->data()); |
} |
void WebGLRenderingContextBase::uniformMatrix2fv(const WebGLUniformLocation* location, GLboolean transpose, GLfloat* v, GLsizei size) |
{ |
if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, v, size, 4)) |
return; |
- webContext()->uniformMatrix2fv(location->location(), size / 4, transpose, v); |
+ m_context->uniformMatrix2fv(location->location(), size / 4, transpose, v); |
} |
void WebGLRenderingContextBase::uniformMatrix3fv(const WebGLUniformLocation* location, GLboolean transpose, Float32Array* v) |
{ |
if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, v, 9)) |
return; |
- webContext()->uniformMatrix3fv(location->location(), v->length() / 9, transpose, v->data()); |
+ m_context->uniformMatrix3fv(location->location(), v->length() / 9, transpose, v->data()); |
} |
void WebGLRenderingContextBase::uniformMatrix3fv(const WebGLUniformLocation* location, GLboolean transpose, GLfloat* v, GLsizei size) |
{ |
if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, v, size, 9)) |
return; |
- webContext()->uniformMatrix3fv(location->location(), size / 9, transpose, v); |
+ m_context->uniformMatrix3fv(location->location(), size / 9, transpose, v); |
} |
void WebGLRenderingContextBase::uniformMatrix4fv(const WebGLUniformLocation* location, GLboolean transpose, Float32Array* v) |
{ |
if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, v, 16)) |
return; |
- webContext()->uniformMatrix4fv(location->location(), v->length() / 16, transpose, v->data()); |
+ m_context->uniformMatrix4fv(location->location(), v->length() / 16, transpose, v->data()); |
} |
void WebGLRenderingContextBase::uniformMatrix4fv(const WebGLUniformLocation* location, GLboolean transpose, GLfloat* v, GLsizei size) |
{ |
if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, v, size, 16)) |
return; |
- webContext()->uniformMatrix4fv(location->location(), size / 16, transpose, v); |
+ m_context->uniformMatrix4fv(location->location(), size / 16, transpose, v); |
} |
void WebGLRenderingContextBase::useProgram(WebGLProgram* program) |
@@ -3947,9 +3949,9 @@ |
} |
if (m_currentProgram != program) { |
if (m_currentProgram) |
- m_currentProgram->onDetached(webContext()); |
+ m_currentProgram->onDetached(m_context.get()); |
m_currentProgram = program; |
- webContext()->useProgram(objectOrZero(program)); |
+ m_context->useProgram(objectOrZero(program)); |
if (program) |
program->onAttached(); |
} |
@@ -3959,7 +3961,7 @@ |
{ |
if (isContextLost() || !validateWebGLObject("validateProgram", program)) |
return; |
- webContext()->validateProgram(objectOrZero(program)); |
+ m_context->validateProgram(objectOrZero(program)); |
} |
void WebGLRenderingContextBase::vertexAttrib1f(GLuint index, GLfloat v0) |
@@ -4062,7 +4064,7 @@ |
GLsizei bytesPerElement = size * typeSize; |
m_boundVertexArrayObject->setVertexAttribState(index, bytesPerElement, size, type, normalized, stride, static_cast<GLintptr>(offset), m_boundArrayBuffer); |
- webContext()->vertexAttribPointer(index, size, type, normalized, stride, static_cast<GLintptr>(offset)); |
+ m_context->vertexAttribPointer(index, size, type, normalized, stride, static_cast<GLintptr>(offset)); |
} |
void WebGLRenderingContextBase::vertexAttribDivisorANGLE(GLuint index, GLuint divisor) |
@@ -4076,7 +4078,7 @@ |
} |
m_boundVertexArrayObject->setVertexAttribDivisor(index, divisor); |
- webContext()->vertexAttribDivisorANGLE(index, divisor); |
+ m_context->vertexAttribDivisorANGLE(index, divisor); |
} |
void WebGLRenderingContextBase::viewport(GLint x, GLint y, GLsizei width, GLsizei height) |
@@ -4085,7 +4087,7 @@ |
return; |
if (!validateSize("viewport", width, height)) |
return; |
- webContext()->viewport(x, y, width, height); |
+ m_context->viewport(x, y, width, height); |
} |
void WebGLRenderingContextBase::forceLostContext(WebGLRenderingContextBase::LostContextMode mode) |
@@ -4110,7 +4112,7 @@ |
// Inform the embedder that a lost context was received. In response, the embedder might |
// decide to take action such as asking the user for permission to use WebGL again. |
if (LocalFrame* frame = canvas()->document().frame()) |
- frame->loader().client()->didLoseWebGLContext(webContext()->getGraphicsResetStatusARB()); |
+ frame->loader().client()->didLoseWebGLContext(m_context->getGraphicsResetStatusARB()); |
} |
// Make absolutely sure we do not refer to an already-deleted texture or framebuffer. |
@@ -4164,14 +4166,13 @@ |
blink::WebLayer* WebGLRenderingContextBase::platformLayer() const |
{ |
- return isContextLost() ? 0 : m_drawingBuffer->platformLayer(); |
+ return m_drawingBuffer->platformLayer(); |
} |
Extensions3DUtil* WebGLRenderingContextBase::extensionsUtil() |
{ |
- ASSERT(!isContextLost()); |
if (!m_extensionsUtil) |
- m_extensionsUtil = adoptPtr(new Extensions3DUtil(webContext())); |
+ m_extensionsUtil = adoptPtr(new Extensions3DUtil(m_context.get())); |
return m_extensionsUtil.get(); |
} |
@@ -4222,7 +4223,7 @@ |
{ |
GLboolean value = 0; |
if (!isContextLost()) |
- webContext()->getBooleanv(pname, &value); |
+ m_context->getBooleanv(pname, &value); |
return WebGLGetInfo(static_cast<bool>(value)); |
} |
@@ -4234,7 +4235,7 @@ |
} |
GLboolean value[4] = {0}; |
if (!isContextLost()) |
- webContext()->getBooleanv(pname, value); |
+ m_context->getBooleanv(pname, value); |
bool boolValue[4]; |
for (int ii = 0; ii < 4; ++ii) |
boolValue[ii] = static_cast<bool>(value[ii]); |
@@ -4245,7 +4246,7 @@ |
{ |
GLfloat value = 0; |
if (!isContextLost()) |
- webContext()->getFloatv(pname, &value); |
+ m_context->getFloatv(pname, &value); |
return WebGLGetInfo(value); |
} |
@@ -4253,7 +4254,7 @@ |
{ |
GLint value = 0; |
if (!isContextLost()) |
- webContext()->getIntegerv(pname, &value); |
+ m_context->getIntegerv(pname, &value); |
return WebGLGetInfo(value); |
} |
@@ -4261,7 +4262,7 @@ |
{ |
GLint value = 0; |
if (!isContextLost()) |
- webContext()->getIntegerv(pname, &value); |
+ m_context->getIntegerv(pname, &value); |
return WebGLGetInfo(static_cast<unsigned>(value)); |
} |
@@ -4269,7 +4270,7 @@ |
{ |
GLfloat value[4] = {0}; |
if (!isContextLost()) |
- webContext()->getFloatv(pname, value); |
+ m_context->getFloatv(pname, value); |
unsigned length = 0; |
switch (pname) { |
case GL_ALIASED_POINT_SIZE_RANGE: |
@@ -4291,7 +4292,7 @@ |
{ |
GLint value[4] = {0}; |
if (!isContextLost()) |
- webContext()->getIntegerv(pname, value); |
+ m_context->getIntegerv(pname, value); |
unsigned length = 0; |
switch (pname) { |
case GL_MAX_VIEWPORT_DIMS: |
@@ -4317,10 +4318,10 @@ |
if ((m_textureUnits[ii].m_texture2DBinding.get() && m_textureUnits[ii].m_texture2DBinding->needToUseBlackTexture(flag)) |
|| (m_textureUnits[ii].m_textureCubeMapBinding.get() && m_textureUnits[ii].m_textureCubeMapBinding->needToUseBlackTexture(flag))) { |
if (ii != m_activeTextureUnit) { |
- webContext()->activeTexture(ii); |
+ m_context->activeTexture(ii); |
resetActiveUnit = true; |
} else if (resetActiveUnit) { |
- webContext()->activeTexture(ii); |
+ m_context->activeTexture(ii); |
resetActiveUnit = false; |
} |
WebGLTexture* tex2D; |
@@ -4337,13 +4338,13 @@ |
texCubeMap = m_textureUnits[ii].m_textureCubeMapBinding.get(); |
} |
if (m_textureUnits[ii].m_texture2DBinding && m_textureUnits[ii].m_texture2DBinding->needToUseBlackTexture(flag)) |
- webContext()->bindTexture(GL_TEXTURE_2D, objectOrZero(tex2D)); |
+ m_context->bindTexture(GL_TEXTURE_2D, objectOrZero(tex2D)); |
if (m_textureUnits[ii].m_textureCubeMapBinding && m_textureUnits[ii].m_textureCubeMapBinding->needToUseBlackTexture(flag)) |
- webContext()->bindTexture(GL_TEXTURE_CUBE_MAP, objectOrZero(texCubeMap)); |
+ m_context->bindTexture(GL_TEXTURE_CUBE_MAP, objectOrZero(texCubeMap)); |
} |
} |
if (resetActiveUnit) |
- webContext()->activeTexture(m_activeTextureUnit); |
+ m_context->activeTexture(m_activeTextureUnit); |
} |
void WebGLRenderingContextBase::createFallbackBlackTextures1x1() |
@@ -4351,25 +4352,25 @@ |
// All calling functions check isContextLost, so a duplicate check is not needed here. |
unsigned char black[] = {0, 0, 0, 255}; |
m_blackTexture2D = createTexture(); |
- webContext()->bindTexture(GL_TEXTURE_2D, m_blackTexture2D->object()); |
- webContext()->texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, |
+ m_context->bindTexture(GL_TEXTURE_2D, m_blackTexture2D->object()); |
+ m_context->texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, |
0, GL_RGBA, GL_UNSIGNED_BYTE, black); |
- webContext()->bindTexture(GL_TEXTURE_2D, 0); |
+ m_context->bindTexture(GL_TEXTURE_2D, 0); |
m_blackTextureCubeMap = createTexture(); |
- webContext()->bindTexture(GL_TEXTURE_CUBE_MAP, m_blackTextureCubeMap->object()); |
- webContext()->texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, 1, 1, |
+ m_context->bindTexture(GL_TEXTURE_CUBE_MAP, m_blackTextureCubeMap->object()); |
+ m_context->texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, 1, 1, |
0, GL_RGBA, GL_UNSIGNED_BYTE, black); |
- webContext()->texImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGBA, 1, 1, |
+ m_context->texImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGBA, 1, 1, |
0, GL_RGBA, GL_UNSIGNED_BYTE, black); |
- webContext()->texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGBA, 1, 1, |
+ m_context->texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGBA, 1, 1, |
0, GL_RGBA, GL_UNSIGNED_BYTE, black); |
- webContext()->texImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGBA, 1, 1, |
+ m_context->texImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGBA, 1, 1, |
0, GL_RGBA, GL_UNSIGNED_BYTE, black); |
- webContext()->texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGBA, 1, 1, |
+ m_context->texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGBA, 1, 1, |
0, GL_RGBA, GL_UNSIGNED_BYTE, black); |
- webContext()->texImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGBA, 1, 1, |
+ m_context->texImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGBA, 1, 1, |
0, GL_RGBA, GL_UNSIGNED_BYTE, black); |
- webContext()->bindTexture(GL_TEXTURE_CUBE_MAP, 0); |
+ m_context->bindTexture(GL_TEXTURE_CUBE_MAP, 0); |
} |
bool WebGLRenderingContextBase::isTexInternalFormatColorBufferCombinationValid(GLenum texInternalFormat, GLenum colorBufferFormat) |
@@ -5146,7 +5147,7 @@ |
} |
const char* reason = "framebuffer incomplete"; |
- if (m_framebufferBinding && !m_framebufferBinding->onAccess(webContext(), &reason)) { |
+ if (m_framebufferBinding && !m_framebufferBinding->onAccess(m_context.get(), &reason)) { |
synthesizeGLError(GL_INVALID_FRAMEBUFFER_OPERATION, functionName, reason); |
return false; |
} |
@@ -5196,7 +5197,7 @@ |
} |
const char* reason = "framebuffer incomplete"; |
- if (m_framebufferBinding && !m_framebufferBinding->onAccess(webContext(), &reason)) { |
+ if (m_framebufferBinding && !m_framebufferBinding->onAccess(m_context.get(), &reason)) { |
synthesizeGLError(GL_INVALID_FRAMEBUFFER_OPERATION, functionName, reason); |
return false; |
} |
@@ -5234,16 +5235,16 @@ |
// In GL, we skip setting vertexAttrib0 values. |
switch (expectedSize) { |
case 1: |
- webContext()->vertexAttrib1f(index, v0); |
+ m_context->vertexAttrib1f(index, v0); |
break; |
case 2: |
- webContext()->vertexAttrib2f(index, v0, v1); |
+ m_context->vertexAttrib2f(index, v0, v1); |
break; |
case 3: |
- webContext()->vertexAttrib3f(index, v0, v1, v2); |
+ m_context->vertexAttrib3f(index, v0, v1, v2); |
break; |
case 4: |
- webContext()->vertexAttrib4f(index, v0, v1, v2, v3); |
+ m_context->vertexAttrib4f(index, v0, v1, v2, v3); |
break; |
} |
VertexAttribValue& attribValue = m_vertexAttribValue[index]; |
@@ -5283,16 +5284,16 @@ |
// In GL, we skip setting vertexAttrib0 values. |
switch (expectedSize) { |
case 1: |
- webContext()->vertexAttrib1fv(index, v); |
+ m_context->vertexAttrib1fv(index, v); |
break; |
case 2: |
- webContext()->vertexAttrib2fv(index, v); |
+ m_context->vertexAttrib2fv(index, v); |
break; |
case 3: |
- webContext()->vertexAttrib3fv(index, v); |
+ m_context->vertexAttrib3fv(index, v); |
break; |
case 4: |
- webContext()->vertexAttrib4fv(index, v); |
+ m_context->vertexAttrib4fv(index, v); |
break; |
} |
VertexAttribValue& attribValue = m_vertexAttribValue[index]; |
@@ -5335,16 +5336,7 @@ |
blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes->attributes(canvas()->document().topDocument().url().string(), settings); |
OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(attributes)); |
- |
- ASSERT(!m_drawingBuffer); |
- if (context) { |
- RefPtr<WebGLRenderingContextEvictionManager> contextEvictionManager = adoptRef(new WebGLRenderingContextEvictionManager()); |
- DrawingBuffer::PreserveDrawingBuffer preserve = m_requestedAttributes->preserveDrawingBuffer() ? DrawingBuffer::Preserve : DrawingBuffer::Discard; |
- m_drawingBuffer = DrawingBuffer::create(context.release(), clampedCanvasSize(), preserve, contextEvictionManager.release()); |
- } |
- |
- bool failToRestore = !m_drawingBuffer; |
- if (failToRestore) { |
+ if (!context) { |
if (m_contextLostMode == RealLostContext) { |
m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts); |
} else { |
@@ -5354,8 +5346,21 @@ |
return; |
} |
+ RefPtr<WebGLRenderingContextEvictionManager> contextEvictionManager = adoptRef(new WebGLRenderingContextEvictionManager()); |
+ |
+ // Construct a new drawing buffer with the new WebGraphicsContext3D. |
+ m_drawingBuffer->releaseResources(); |
+ DrawingBuffer::PreserveDrawingBuffer preserve = m_requestedAttributes->preserveDrawingBuffer() ? DrawingBuffer::Preserve : DrawingBuffer::Discard; |
+ m_drawingBuffer = DrawingBuffer::create(context.get(), clampedCanvasSize(), preserve, contextEvictionManager.release()); |
+ |
+ if (m_drawingBuffer->isZeroSized()) |
+ return; |
+ |
m_drawingBuffer->bind(); |
+ |
m_lostContextErrors.clear(); |
+ |
+ m_context = context.release(); |
m_contextLost = false; |
setupFlags(); |
@@ -5438,7 +5443,7 @@ |
printGLErrorToConsole(message); |
} |
if (!isContextLost()) |
- webContext()->synthesizeGLError(error); |
+ m_context->synthesizeGLError(error); |
else { |
if (m_lostContextErrors.find(error) == WTF::kNotFound) |
m_lostContextErrors.append(error); |
@@ -5474,9 +5479,9 @@ |
if (isContextLost()) |
return; |
if (enable) |
- webContext()->enable(capability); |
+ m_context->enable(capability); |
else |
- webContext()->disable(capability); |
+ m_context->disable(capability); |
} |
IntSize WebGLRenderingContextBase::clampedCanvasSize() |
@@ -5490,9 +5495,9 @@ |
if (isContextLost() || !extensionEnabled(WebGLDrawBuffersName)) |
return 0; |
if (!m_maxDrawBuffers) |
- webContext()->getIntegerv(GL_MAX_DRAW_BUFFERS_EXT, &m_maxDrawBuffers); |
+ m_context->getIntegerv(GL_MAX_DRAW_BUFFERS_EXT, &m_maxDrawBuffers); |
if (!m_maxColorAttachments) |
- webContext()->getIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &m_maxColorAttachments); |
+ m_context->getIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &m_maxColorAttachments); |
// WEBGL_draw_buffers requires MAX_COLOR_ATTACHMENTS >= MAX_DRAW_BUFFERS. |
return std::min(m_maxDrawBuffers, m_maxColorAttachments); |
} |
@@ -5502,7 +5507,7 @@ |
if (isContextLost() || !extensionEnabled(WebGLDrawBuffersName)) |
return 0; |
if (!m_maxColorAttachments) |
- webContext()->getIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &m_maxColorAttachments); |
+ m_context->getIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &m_maxColorAttachments); |
return m_maxColorAttachments; |
} |