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 d68fc81179e5269e393a96be7bb863c71a8ca634..2a1d65781565e681403da7307c3bb6190223b5bf 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| @@ -102,6 +102,11 @@ PassRefPtr<DrawingBuffer> DrawingBuffer::create(PassOwnPtr<WebGraphicsContext3D> |
| // This might be the first time we notice that the WebGraphicsContext3D is lost. |
| return nullptr; |
| } |
| + bool packedDepthStencilSupported = extensionsUtil->supportsExtension("GL_OES_packed_depth_stencil"); |
| + if (!packedDepthStencilSupported) { |
| + return nullptr; |
| + } |
| + extensionsUtil->ensureExtensionEnabled("GL_OES_packed_depth_stencil"); |
|
Ken Russell (switch to Gerrit)
2016/02/08 21:39:45
I wonder whether these checks could be replaced wi
Zhenyao Mo
2016/02/09 17:21:23
Done.
|
| bool multisampleSupported = (extensionsUtil->supportsExtension("GL_CHROMIUM_framebuffer_multisample") |
| || extensionsUtil->supportsExtension("GL_EXT_multisampled_render_to_texture")) |
| && extensionsUtil->supportsExtension("GL_OES_rgb8_rgba8"); |
| @@ -112,9 +117,6 @@ PassRefPtr<DrawingBuffer> DrawingBuffer::create(PassOwnPtr<WebGraphicsContext3D> |
| else |
| extensionsUtil->ensureExtensionEnabled("GL_EXT_multisampled_render_to_texture"); |
| } |
| - bool packedDepthStencilSupported = extensionsUtil->supportsExtension("GL_OES_packed_depth_stencil"); |
| - if (packedDepthStencilSupported) |
| - extensionsUtil->ensureExtensionEnabled("GL_OES_packed_depth_stencil"); |
| bool discardFramebufferSupported = extensionsUtil->supportsExtension("GL_EXT_discard_framebuffer"); |
| if (discardFramebufferSupported) |
| extensionsUtil->ensureExtensionEnabled("GL_EXT_discard_framebuffer"); |
| @@ -708,8 +710,7 @@ void DrawingBuffer::resizeDepthStencil(const IntSize& size) |
| m_context->renderbufferStorageMultisampleCHROMIUM(GL_RENDERBUFFER, m_sampleCount, GL_DEPTH24_STENCIL8_OES, size.width(), size.height()); |
| else |
| m_context->renderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, size.width(), size.height()); |
| - m_context->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilBuffer); |
| - m_context->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilBuffer); |
| + m_context->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilBuffer); |
| } else { |
| if (m_requestedAttributes.depth) { |
| if (!m_depthBuffer) |