| Index: content/browser/gpu/browser_gpu_memory_buffer_manager.cc
|
| diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
|
| index 23d2b50efd5179d06676a057e067b2238793b33a..acf1ccf498611068a69561e858e9560741eb9f31 100644
|
| --- a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
|
| +++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
|
| @@ -19,6 +19,7 @@
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/common/content_switches.h"
|
| #include "gpu/GLES2/gl2extchromium.h"
|
| +#include "ui/gl/gl_switches.h"
|
|
|
| #if defined(OS_MACOSX)
|
| #include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h"
|
| @@ -87,8 +88,23 @@ gfx::GpuMemoryBufferType GetGpuMemoryBufferFactoryType() {
|
| std::vector<GpuMemoryBufferFactory::Configuration>
|
| GetSupportedGpuMemoryBufferConfigurations(gfx::GpuMemoryBufferType type) {
|
| std::vector<GpuMemoryBufferFactory::Configuration> configurations;
|
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kEnableNativeGpuMemoryBuffers)) {
|
| +#if defined(OS_MACOSX)
|
| + bool enable_native_gpu_memory_buffers =
|
| + !base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kDisableNativeGpuMemoryBuffers);
|
| +#else
|
| + bool enable_native_gpu_memory_buffers =
|
| + base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableNativeGpuMemoryBuffers);
|
| +#endif
|
| +
|
| + // Disable native buffers when using Mesa.
|
| + if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
| + switches::kUseGL) == gfx::kGLImplementationOSMesaName) {
|
| + enable_native_gpu_memory_buffers = false;
|
| + }
|
| +
|
| + if (enable_native_gpu_memory_buffers) {
|
| const GpuMemoryBufferFactory::Configuration kNativeConfigurations[] = {
|
| {gfx::GpuMemoryBuffer::R_8, gfx::GpuMemoryBuffer::MAP},
|
| {gfx::GpuMemoryBuffer::R_8, gfx::GpuMemoryBuffer::PERSISTENT_MAP},
|
|
|