Index: cc/switches.cc |
diff --git a/cc/switches.cc b/cc/switches.cc |
index 1352f3ae98fcf9a7eafc66f931448830ccbb2465..cbb83fae6b58e249c7ab4751fc639d4e05cf4853 100644 |
--- a/cc/switches.cc |
+++ b/cc/switches.cc |
@@ -17,6 +17,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"; |
@@ -74,5 +78,20 @@ const char kSlowDownRasterScaleFactor[] = "slow-down-raster-scale-factor"; |
// Schedule rasterization jobs according to their estimated processing cost. |
const char kUseCheapnessEstimator[] = "use-cheapness-estimator"; |
+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 |