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

Unified Diff: content/browser/gpu/browser_gpu_memory_buffer_manager.cc

Issue 1165823003: Re-land: content: Enable native GpuMemoryBuffers by default on MacOSX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make sure native buffers are disabled when using mesa Created 5 years, 5 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 | content/child/child_thread_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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},
« no previous file with comments | « no previous file | content/child/child_thread_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698