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

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

Issue 1830453002: WebGL: GL_RGB emulation for IOSurface backed textures. [For reference only] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile error. Created 4 years, 9 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 | « gpu/ipc/common/gpu_memory_buffer_support.cc ('k') | third_party/khronos/GLES2/gl2ext.h » ('j') | 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 518f87bd312111fefa02c42d13e67eae68b2fa57..0a076575058f3c623a871aa429a544f90443d0ad 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -348,9 +348,15 @@ DrawingBuffer::TextureParameters DrawingBuffer::chromiumImageTextureParameters()
// on OSX.
TextureParameters parameters;
parameters.target = GC3D_TEXTURE_RECTANGLE_ARB;
- parameters.internalColorFormat = GL_BGRA_EXT;
- parameters.internalRenderbufferFormat = GL_RGBA8_OES;
- parameters.colorFormat = GL_RGBA;
+ if (m_requestedAttributes.alpha) {
+ parameters.internalColorFormat = GL_BGRA_EXT;
+ parameters.internalRenderbufferFormat = GL_RGBA8_OES;
+ parameters.colorFormat = GL_RGBA;
+ } else {
+ parameters.internalColorFormat = GL_BGR_EXT;
+ parameters.internalRenderbufferFormat = GL_RGB8_OES;
+ parameters.colorFormat = GL_RGB;
+ }
return parameters;
#else
return defaultTextureParameters();
@@ -958,12 +964,6 @@ void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info)
DrawingBuffer::TextureInfo DrawingBuffer::createTextureAndAllocateMemory(const IntSize& size)
{
- // TODO(erikchen): Add support for a CHROMIUM_image back buffer whose
- // behavior mimics a texture with internal format GL_RGB.
- // https://crbug.com/581777.
- if (!m_requestedAttributes.alpha)
- return createDefaultTextureAndAllocateMemory(size);
-
if (!RuntimeEnabledFeatures::webGLImageChromiumEnabled())
return createDefaultTextureAndAllocateMemory(size);
« no previous file with comments | « gpu/ipc/common/gpu_memory_buffer_support.cc ('k') | third_party/khronos/GLES2/gl2ext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698