| 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 4dea14b5ef679d0e13d11ebeea7c4e467eff90dc..df28ac3c8d30949935fafbe5b545df3f4a642160 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
|
| @@ -104,27 +104,21 @@
|
| }
|
| ASSERT(extensionsUtil->supportsExtension("GL_OES_packed_depth_stencil"));
|
| extensionsUtil->ensureExtensionEnabled("GL_OES_packed_depth_stencil");
|
| -
|
| - SupportedExtensions exts;
|
| - exts.multisample = (extensionsUtil->supportsExtension("GL_CHROMIUM_framebuffer_multisample")
|
| + bool multisampleSupported = (extensionsUtil->supportsExtension("GL_CHROMIUM_framebuffer_multisample")
|
| || extensionsUtil->supportsExtension("GL_EXT_multisampled_render_to_texture"))
|
| && extensionsUtil->supportsExtension("GL_OES_rgb8_rgba8");
|
| - if (exts.multisample) {
|
| + if (multisampleSupported) {
|
| extensionsUtil->ensureExtensionEnabled("GL_OES_rgb8_rgba8");
|
| if (extensionsUtil->supportsExtension("GL_CHROMIUM_framebuffer_multisample"))
|
| extensionsUtil->ensureExtensionEnabled("GL_CHROMIUM_framebuffer_multisample");
|
| else
|
| extensionsUtil->ensureExtensionEnabled("GL_EXT_multisampled_render_to_texture");
|
| }
|
| - exts.packedDepthStencil = true;
|
| - exts.depth24 = extensionsUtil->supportsExtension("GL_OES_depth24");
|
| - if (exts.depth24)
|
| - extensionsUtil->ensureExtensionEnabled("GL_OES_depth24");
|
| - exts.discardFramebuffer = extensionsUtil->supportsExtension("GL_EXT_discard_framebuffer");
|
| - if (exts.discardFramebuffer)
|
| + bool discardFramebufferSupported = extensionsUtil->supportsExtension("GL_EXT_discard_framebuffer");
|
| + if (discardFramebufferSupported)
|
| extensionsUtil->ensureExtensionEnabled("GL_EXT_discard_framebuffer");
|
|
|
| - RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(std::move(context), extensionsUtil.release(), exts, preserve, requestedAttributes));
|
| + RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(std::move(context), extensionsUtil.release(), multisampleSupported, true, discardFramebufferSupported, preserve, requestedAttributes));
|
| if (!drawingBuffer->initialize(size)) {
|
| drawingBuffer->beginDestruction();
|
| return PassRefPtr<DrawingBuffer>();
|
| @@ -137,12 +131,11 @@
|
| shouldFailDrawingBufferCreationForTesting = true;
|
| }
|
|
|
| -DrawingBuffer::SupportedExtensions::SupportedExtensions() :
|
| - multisample(false), packedDepthStencil(false), depth24(false), discardFramebuffer(false) {}
|
| -
|
| DrawingBuffer::DrawingBuffer(PassOwnPtr<WebGraphicsContext3D> context,
|
| PassOwnPtr<Extensions3DUtil> extensionsUtil,
|
| - const SupportedExtensions& supportedExtensions,
|
| + bool multisampleExtensionSupported,
|
| + bool packedDepthStencilExtensionSupported,
|
| + bool discardFramebufferSupported,
|
| PreserveDrawingBuffer preserve,
|
| WebGraphicsContext3D::Attributes requestedAttributes)
|
| : m_preserveDrawingBuffer(preserve)
|
| @@ -155,10 +148,9 @@
|
| , m_extensionsUtil(std::move(extensionsUtil))
|
| , m_size(-1, -1)
|
| , m_requestedAttributes(requestedAttributes)
|
| - , m_multisampleExtensionSupported(supportedExtensions.multisample)
|
| - , m_packedDepthStencilExtensionSupported(supportedExtensions.packedDepthStencil)
|
| - , m_depth24ExtensionSupported(supportedExtensions.depth24)
|
| - , m_discardFramebufferSupported(supportedExtensions.discardFramebuffer)
|
| + , m_multisampleExtensionSupported(multisampleExtensionSupported)
|
| + , m_packedDepthStencilExtensionSupported(packedDepthStencilExtensionSupported)
|
| + , m_discardFramebufferSupported(discardFramebufferSupported)
|
| , m_fbo(0)
|
| , m_depthStencilBuffer(0)
|
| , m_depthBuffer(0)
|
| @@ -705,18 +697,7 @@
|
| if (!m_requestedAttributes.depth && !m_requestedAttributes.stencil)
|
| return;
|
|
|
| - if (m_requestedAttributes.depth && !m_requestedAttributes.stencil && m_depth24ExtensionSupported) {
|
| - if (!m_depthBuffer)
|
| - m_depthBuffer = m_context->createRenderbuffer();
|
| - m_context->bindRenderbuffer(GL_RENDERBUFFER, m_depthBuffer);
|
| - if (m_antiAliasingMode == MSAAImplicitResolve)
|
| - m_context->renderbufferStorageMultisampleEXT(GL_RENDERBUFFER, m_sampleCount, GL_DEPTH_COMPONENT24, size.width(), size.height());
|
| - else if (m_antiAliasingMode == MSAAExplicitResolve)
|
| - m_context->renderbufferStorageMultisampleCHROMIUM(GL_RENDERBUFFER, m_sampleCount, GL_DEPTH_COMPONENT24, size.width(), size.height());
|
| - else
|
| - m_context->renderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, size.width(), size.height());
|
| - m_context->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthBuffer);
|
| - } else if (m_packedDepthStencilExtensionSupported) {
|
| + if (m_packedDepthStencilExtensionSupported) {
|
| if (!m_depthStencilBuffer)
|
| m_depthStencilBuffer = m_context->createRenderbuffer();
|
| m_context->bindRenderbuffer(GL_RENDERBUFFER, m_depthStencilBuffer);
|
|
|