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

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

Issue 22797008: Force delegated renderer on Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix whitespace Created 7 years, 4 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 | « content/browser/gpu/compositor_util.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('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 9270300d2968439ed06686719c548c4cbe29232b..8afd0e9204a846932243b1a716c0cc838bdfd61e 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -103,4 +103,28 @@ bool IsForceCompositingModeEnabled() {
trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName);
}
+bool IsDelegatedRendererEnabled() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ bool enabled = false;
+
+#if defined(USE_AURA)
+ // Default to true on Aura, but allow override via flags.
+ enabled = true;
+#endif
+
+ // Flags override.
+ enabled |= command_line.HasSwitch(switches::kEnableDelegatedRenderer);
+ enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer);
+
+ // Needs compositing, and thread.
+ if (enabled &&
+ (!IsForceCompositingModeEnabled() || !IsThreadedCompositingEnabled())) {
+ enabled = false;
+ LOG(ERROR) << "Disabling delegated-rendering because it needs "
+ << "force-compositing-mode and threaded-compositing.";
+ }
+
+ return enabled;
+}
+
} // namespace content
« no previous file with comments | « content/browser/gpu/compositor_util.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698