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

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

Issue 344703002: Revert of Remove EnableThreadedCompositing from the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/gpu/compositor_util_browsertest.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 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());
}
« no previous file with comments | « content/browser/gpu/compositor_util.h ('k') | content/browser/gpu/compositor_util_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698