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

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

Issue 1474763002: Revert of webgl: use immutable texture for the default FBO. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3a62898318e34cae2523f1aaafa0e343ab0c2a05..c8b928e6ba2d410cba0eae8b5697184f5e3e19a7 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -151,7 +151,6 @@
, m_multisampleExtensionSupported(multisampleExtensionSupported)
, m_packedDepthStencilExtensionSupported(packedDepthStencilExtensionSupported)
, m_discardFramebufferSupported(discardFramebufferSupported)
- , m_storageTextureSupported(false)
, m_fbo(0)
, m_depthStencilBuffer(0)
, m_depthBuffer(0)
@@ -306,8 +305,7 @@
m_context->discardFramebufferEXT(GL_FRAMEBUFFER, 3, attachments);
}
} else {
- m_context->copySubTextureCHROMIUM(GL_TEXTURE_2D, m_colorBuffer.textureId, frontColorBufferMailbox->textureInfo.textureId,
- 0, 0, 0, 0, m_size.width(), m_size.height(), GL_FALSE, GL_FALSE, GL_FALSE);
+ m_context->copyTextureCHROMIUM(GL_TEXTURE_2D, m_colorBuffer.textureId, frontColorBufferMailbox->textureInfo.textureId, GL_RGBA, GL_UNSIGNED_BYTE, GL_FALSE, GL_FALSE, GL_FALSE);
}
restoreFramebufferBindings();
@@ -451,7 +449,6 @@
}
}
m_sampleCount = std::min(4, maxSampleCount);
- m_storageTextureSupported = m_extensionsUtil->supportsExtension("GL_EXT_texture_storage");
m_fbo = m_context->createFramebuffer();
@@ -962,6 +959,12 @@
}
}
+void DrawingBuffer::texImage2DResourceSafe(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLint unpackAlignment)
+{
+ ASSERT(unpackAlignment == 1 || unpackAlignment == 2 || unpackAlignment == 4 || unpackAlignment == 8);
+ m_context->texImage2D(target, level, internalformat, width, height, border, format, type, 0);
+}
+
void DrawingBuffer::allocateTextureMemory(TextureInfo* info, const IntSize& size)
{
if (RuntimeEnabledFeatures::webGLImageChromiumEnabled()) {
@@ -974,18 +977,7 @@
}
}
- if (m_storageTextureSupported) {
- if (info->immutable) {
- m_context->deleteTexture(info->textureId);
- info->textureId = createColorTexture();
- }
-
- // TODO(dshwang): GL_BGRA8_EXT can be better in some platforms. crbug.com/557848
- m_context->texStorage2DEXT(GL_TEXTURE_2D, 1, m_internalRenderbufferFormat, size.width(), size.height());
- info->immutable = true;
- return;
- }
- m_context->texImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, size.width(), size.height(), 0, m_colorFormat, GL_UNSIGNED_BYTE, 0);
+ texImage2DResourceSafe(GL_TEXTURE_2D, 0, m_internalColorFormat, size.width(), size.height(), 0, m_colorFormat, GL_UNSIGNED_BYTE);
}
void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info)
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698