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

Unified Diff: cc/switches.cc

Issue 12221005: Add flag to disable impl-side painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 7 years, 10 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 | « cc/switches.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/switches.cc
diff --git a/cc/switches.cc b/cc/switches.cc
index a4b2c35033f881a8ff71e4e201252ab14420eb61..8641ed0767d4872606147cfd29203a4a224c91f9 100644
--- a/cc/switches.cc
+++ b/cc/switches.cc
@@ -4,6 +4,8 @@
#include "cc/switches.h"
+#include "base/command_line.h"
+
namespace cc {
namespace switches {
@@ -17,6 +19,10 @@ const char kDisableThreadedAnimation[] = "disable-threaded-animation";
// Send a message for every frame from the impl thread to the parent compositor.
const char kEnableCompositorFrameMessage[] = "enable-compositor-frame-message";
+// Paint content on the main thread instead of the compositor thread.
+// Overrides the kEnableImplSidePainting flag.
+const char kDisableImplSidePainting[] = "disable-impl-side-painting";
+
// Paint content on the compositor thread instead of the main thread.
const char kEnableImplSidePainting[] = "enable-impl-side-painting";
@@ -78,5 +84,20 @@ const char kUseCheapnessEstimator[] = "use-cheapness-estimator";
const char kLowResolutionContentsScaleFactor[] =
"low-resolution-contents-scale-factor";
+bool IsImplSidePaintingEnabled() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
+ if (command_line.HasSwitch(cc::switches::kDisableImplSidePainting))
+ return false;
+ else if (command_line.HasSwitch(cc::switches::kEnableImplSidePainting))
+ return true;
+
+#if defined(OS_ANDROID)
+ return true;
+#else
+ return false;
+#endif
+}
+
} // namespace switches
} // namespace cc
« no previous file with comments | « cc/switches.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698