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

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

Issue 1421293006: Mac: Use GpuMemoryBuffers by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable when native GMBs are disabled Created 5 years, 1 month 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 | « content/browser/gpu/browser_gpu_memory_buffer_manager.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « content/browser/gpu/browser_gpu_memory_buffer_manager.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698