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..259bb50561947225da8520d40dac3b0d0b551381 100644 |
--- a/content/browser/gpu/compositor_util.cc |
+++ b/content/browser/gpu/compositor_util.cc |
@@ -103,4 +103,23 @@ bool IsForceCompositingModeEnabled() { |
trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName); |
} |
+bool IsDelegatedRendererEnabled() { |
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ bool enabled = false; |
+#if defined(USE_AURA) |
danakj
2013/08/30 00:10:08
nit: space above this.
piman
2013/08/30 04:01:20
Done.
|
+ // 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. |
+ enabled &= IsForceCompositingModeEnabled(); |
danakj
2013/08/30 00:10:08
maybe LOG(ERROR) if one of these causes it to be d
piman
2013/08/30 04:01:20
Done.
|
+ enabled &= IsThreadedCompositingEnabled(); |
+ |
+ return enabled; |
+} |
+ |
} // namespace content |