Index: content/browser/gpu/compositor_util.cc |
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc |
index 2d366757ffd3f780ce585bd974495afdcebf146e..de9fa1c06422b90ef1607d9144c24399c5e9d6a2 100644 |
--- a/content/browser/gpu/compositor_util.cc |
+++ b/content/browser/gpu/compositor_util.cc |
@@ -168,6 +168,24 @@ |
#endif |
} |
+bool IsThreadedCompositingEnabled() { |
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ |
+ // Command line switches take precedence over blacklist. |
+ if (command_line.HasSwitch(switches::kDisableThreadedCompositing)) |
+ return false; |
+ if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) |
+ return true; |
+ |
+#if defined(USE_AURA) || defined(OS_MACOSX) |
+ // We always want threaded compositing on Aura and Mac (the fallback is a |
+ // threaded software compositor). |
+ return true; |
+#else |
+ return false; |
+#endif |
+} |
+ |
bool IsDelegatedRendererEnabled() { |
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
bool enabled = false; |
@@ -182,6 +200,12 @@ |
enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer); |
// Needs compositing, and thread. |
+ if (enabled && !IsThreadedCompositingEnabled()) { |
+ enabled = false; |
+ LOG(ERROR) << "Disabling delegated-rendering because it needs " |
+ << "force-compositing-mode and threaded-compositing."; |
+ } |
+ |
return enabled; |
} |
@@ -199,7 +223,7 @@ |
#if defined(OS_MACOSX) || defined(OS_WIN) |
return false; |
#else |
- return true; |
+ return IsThreadedCompositingEnabled(); |
#endif |
} |
@@ -274,6 +298,10 @@ |
status += "_force"; |
} |
} |
+ if (gpu_feature_info.name == kGpuCompositingFeatureName) { |
+ if (IsThreadedCompositingEnabled()) |
+ status += "_threaded"; |
+ } |
feature_status_dict->SetString( |
gpu_feature_info.name.c_str(), status.c_str()); |
} |