| Index: content/browser/gpu/compositor_util.cc
|
| diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
|
| index 1b77f8b9ccbf4080be85bf2013f4fb30e66dbe25..10f507b3660d96c99bed46d386dcbacdf7f1531f 100644
|
| --- a/content/browser/gpu/compositor_util.cc
|
| +++ b/content/browser/gpu/compositor_util.cc
|
| @@ -12,6 +12,7 @@
|
| #include "build/build_config.h"
|
| #include "cc/base/math_util.h"
|
| #include "cc/base/switches.h"
|
| +#include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
|
| #include "content/browser/gpu/gpu_data_manager_impl.h"
|
| #include "content/public/common/content_switches.h"
|
| #include "gpu/config/gpu_feature_type.h"
|
| @@ -219,8 +220,30 @@ bool IsPartialRasterEnabled() {
|
| bool IsGpuMemoryBufferCompositorResourcesEnabled() {
|
| const base::CommandLine& command_line =
|
| *base::CommandLine::ForCurrentProcess();
|
| - return command_line.HasSwitch(
|
| - switches::kEnableGpuMemoryBufferCompositorResources);
|
| + if (command_line.HasSwitch(
|
| + switches::kEnableGpuMemoryBufferCompositorResources)) {
|
| + return true;
|
| + }
|
| + if (command_line.HasSwitch(
|
| + switches::kDisableGpuMemoryBufferCompositorResources)) {
|
| + return false;
|
| + }
|
| +
|
| + // Native GPU memory buffers are required.
|
| + if (!BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBuffersEnabled())
|
| + return false;
|
| +
|
| + // GPU rasterization does not support GL_TEXTURE_RECTANGLE_ARB, which is
|
| + // required by GpuMemoryBuffers on Mac.
|
| + // http://crbug.com/551072
|
| + if (IsForceGpuRasterizationEnabled() || IsGpuRasterizationEnabled())
|
| + return false;
|
| +
|
| +#if defined(OS_MACOSX)
|
| + return true;
|
| +#else
|
| + return false;
|
| +#endif
|
| }
|
|
|
| bool IsGpuRasterizationEnabled() {
|
|
|