Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| index 9d076873a0afda5bd0e1075be70f60dfb201d757..a0ce5bd09738d1dafdcaadaa3678481ddabd5790 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| @@ -439,7 +439,7 @@ void DrawingBuffer::deleteMailbox(const WebExternalTextureMailbox& mailbox) |
| deleteChromiumImageForTexture(&m_textureMailboxes[i]->textureInfo); |
| - m_context->deleteTexture(m_textureMailboxes[i]->textureInfo.textureId); |
| + m_gl->DeleteTextures(1, &m_textureMailboxes[i]->textureInfo.textureId); |
| m_textureMailboxes.remove(i); |
| return; |
| } |
| @@ -469,7 +469,7 @@ bool DrawingBuffer::initialize(const IntSize& size) |
| } |
| m_sampleCount = std::min(4, maxSampleCount); |
| - m_fbo = m_context->createFramebuffer(); |
| + m_gl->GenFramebuffers(1, &m_fbo); |
| m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fbo); |
| createSecondaryBuffers(); |
| @@ -550,7 +550,7 @@ bool DrawingBuffer::copyToPlatformTexture(WebGraphicsContext3D* context, gpu::gl |
| gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, flipY, unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded); |
| - context->deleteTexture(sourceTexture); |
| + gl->DeleteTextures(1, &sourceTexture); |
| const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); |
| @@ -601,20 +601,20 @@ void DrawingBuffer::beginDestruction() |
| deleteMailbox(m_recycledMailboxQueue.takeLast()); |
| if (m_multisampleFBO) |
| - m_context->deleteFramebuffer(m_multisampleFBO); |
| + m_gl->DeleteFramebuffers(1, &m_multisampleFBO); |
| if (m_fbo) |
| - m_context->deleteFramebuffer(m_fbo); |
| + m_gl->DeleteFramebuffers(1, &m_fbo); |
| if (m_multisampleColorBuffer) |
| - m_context->deleteRenderbuffer(m_multisampleColorBuffer); |
| + m_gl->DeleteRenderbuffers(1, &m_multisampleColorBuffer); |
| if (m_depthStencilBuffer) |
| - m_context->deleteRenderbuffer(m_depthStencilBuffer); |
| + m_gl->DeleteRenderbuffers(1, &m_depthStencilBuffer); |
| if (m_colorBuffer.textureId) { |
| deleteChromiumImageForTexture(&m_colorBuffer); |
| - m_context->deleteTexture(m_colorBuffer.textureId); |
| + m_gl->DeleteTextures(1, &m_colorBuffer.textureId); |
| } |
| setSize(IntSize()); |
| @@ -632,7 +632,8 @@ void DrawingBuffer::beginDestruction() |
| WebGLId DrawingBuffer::createColorTexture(const TextureParameters& parameters) |
| { |
| - WebGLId offscreenColorTexture = m_context->createTexture(); |
| + GLuint offscreenColorTexture; |
| + m_gl->GenTextures(1, &offscreenColorTexture); |
| if (!offscreenColorTexture) |
|
danakj
2016/03/22 00:21:26
This is one problem. Texture id can't be 0 from Ge
Ken Russell (switch to Gerrit)
2016/03/22 00:30:30
What about the situation where the context's been
danakj
2016/03/22 00:37:14
I don't think that has any impact on our ability t
|
| return 0; |
| @@ -649,9 +650,9 @@ void DrawingBuffer::createSecondaryBuffers() |
| { |
| // create a multisample FBO |
| if (m_antiAliasingMode == MSAAExplicitResolve) { |
| - m_multisampleFBO = m_context->createFramebuffer(); |
| + m_gl->GenFramebuffers(1, &m_multisampleFBO); |
| m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_multisampleFBO); |
| - m_multisampleColorBuffer = m_context->createRenderbuffer(); |
| + m_gl->GenRenderbuffers(1, &m_multisampleColorBuffer); |
| } |
| } |
| @@ -692,7 +693,7 @@ void DrawingBuffer::resizeDepthStencil(const IntSize& size) |
| return; |
| if (!m_depthStencilBuffer) |
| - m_depthStencilBuffer = m_context->createRenderbuffer(); |
| + m_gl->GenRenderbuffers(1, &m_depthStencilBuffer); |
| m_gl->BindRenderbuffer(GL_RENDERBUFFER, m_depthStencilBuffer); |
| if (m_antiAliasingMode == MSAAImplicitResolve) |
| m_gl->RenderbufferStorageMultisampleEXT(GL_RENDERBUFFER, m_sampleCount, GL_DEPTH24_STENCIL8_OES, size.width(), size.height()); |
| @@ -878,9 +879,9 @@ bool DrawingBuffer::paintRenderingResultsToImageData(int& width, int& height, So |
| WTF::ArrayBufferContents pixels(width * height, 4, WTF::ArrayBufferContents::NotShared, WTF::ArrayBufferContents::DontInitialize); |
| - GLint fbo = 0; |
| + GLuint fbo = 0; |
| if (sourceBuffer == FrontBuffer && m_frontColorBuffer.texInfo.textureId) { |
| - fbo = m_context->createFramebuffer(); |
| + m_gl->GenFramebuffers(1, &fbo); |
| m_gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); |
| m_gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, m_frontColorBuffer.texInfo.parameters.target, m_frontColorBuffer.texInfo.textureId, 0); |
| } else { |
| @@ -892,7 +893,7 @@ bool DrawingBuffer::paintRenderingResultsToImageData(int& width, int& height, So |
| if (fbo) { |
| m_gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, m_frontColorBuffer.texInfo.parameters.target, 0, 0); |
| - m_context->deleteFramebuffer(fbo); |
| + m_gl->DeleteFramebuffers(1, &fbo); |
| } |
| restoreFramebufferBindings(); |