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 84315810ffd7db1393fb9fcedfd524e2f09c5f46..6193831fb5f242c93be21038711895ee7ab155f4 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| @@ -339,8 +339,9 @@ DrawingBuffer::TextureParameters DrawingBuffer::chromiumImageTextureParameters() |
| parameters.creationInternalColorFormat = GL_RGB; |
| parameters.internalColorFormat = GL_RGBA; |
| } else { |
| - parameters.creationInternalColorFormat = GL_RGB; |
| - parameters.internalColorFormat = GL_RGB; |
| + GLenum format = defaultBufferRequiresAlphaChannelToBePreserved() ? GL_RGBA : GL_RGB; |
| + parameters.creationInternalColorFormat = format; |
| + parameters.internalColorFormat = format; |
| } |
| // Unused when CHROMIUM_image is being used. |
| @@ -360,9 +361,10 @@ DrawingBuffer::TextureParameters DrawingBuffer::defaultTextureParameters() |
| parameters.creationInternalColorFormat = GL_RGBA; |
| parameters.colorFormat = GL_RGBA; |
| } else { |
| - parameters.internalColorFormat = GL_RGB; |
| - parameters.creationInternalColorFormat = GL_RGB; |
| - parameters.colorFormat = GL_RGB; |
| + GLenum format = defaultBufferRequiresAlphaChannelToBePreserved() ? GL_RGBA : GL_RGB; |
| + parameters.creationInternalColorFormat = format; |
| + parameters.internalColorFormat = format; |
| + parameters.colorFormat = format; |
| } |
| return parameters; |
| } |
| @@ -1051,6 +1053,8 @@ GLenum DrawingBuffer::getMultisampledRenderbufferFormat() |
| return GL_RGBA8_OES; |
| if (m_colorBuffer.imageId && contextProvider()->getCapabilities().chromium_image_rgb_emulation) |
| return GL_RGBA8_OES; |
| + if (contextProvider()->getCapabilities().disable_webgl_rgb_multisampling_usage) |
|
Ken Russell (switch to Gerrit)
2016/05/19 00:06:41
It seems a little strange that this checks a diffe
erikchen
2016/06/02 00:14:06
defaultBufferRequiresAlphaChannelToBePreserved cal
Ken Russell (switch to Gerrit)
2016/06/02 00:46:10
Ah, I see. Thanks for the explanation.
|
| + return GL_RGBA8_OES; |
| return GL_RGB8_OES; |
| } |