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 |