Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 1814263004: Remove create/delete methods from WebGraphicsContext3D. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@complex-casts
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 277226515ae2aaedbaa28badcc3a3c6fc03b6014..ad81c66fc733dbaa88b15addc9e29c5561924bd2 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -438,7 +438,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;
}
@@ -468,7 +468,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();
@@ -548,7 +548,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();
@@ -599,20 +599,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());
@@ -630,7 +630,8 @@ void DrawingBuffer::beginDestruction()
WebGLId DrawingBuffer::createColorTexture(const TextureParameters& parameters)
{
- WebGLId offscreenColorTexture = m_context->createTexture();
+ uint32_t offscreenColorTexture;
+ m_gl->GenTextures(1, &offscreenColorTexture);
if (!offscreenColorTexture)
return 0;
@@ -647,9 +648,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);
}
}
@@ -690,7 +691,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());
@@ -876,9 +877,9 @@ bool DrawingBuffer::paintRenderingResultsToImageData(int& width, int& height, So
WTF::ArrayBufferContents pixels(width * height, 4, WTF::ArrayBufferContents::NotShared, WTF::ArrayBufferContents::DontInitialize);
- GLint fbo = 0;
+ uint32_t 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 {
@@ -890,7 +891,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();

Powered by Google App Engine
This is Rietveld 408576698