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

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

Issue 1952913002: Use GL_RGBA renderbuffer for antialiased, no-alpha DrawingBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp42_drawingbuffer_cleanup2
Patch Set: Rebase. Created 4 years, 7 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
« no previous file with comments | « no previous file | 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 cef880da0f1f1bf886c15be64c4dec1bd9304747..714a6ab58954d108f0851fe6f86383f3a69f04df 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;
}
@@ -1061,6 +1063,8 @@ GLenum DrawingBuffer::getMultisampledRenderbufferFormat()
return GL_RGBA8_OES;
if (RuntimeEnabledFeatures::webGLImageChromiumEnabled() && contextProvider()->getCapabilities().chromium_image_rgb_emulation)
return GL_RGBA8_OES;
+ if (contextProvider()->getCapabilities().disable_webgl_rgb_multisampling_usage)
+ return GL_RGBA8_OES;
return GL_RGB8_OES;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698