Chromium Code Reviews| Index: cc/base/switches.cc |
| diff --git a/cc/base/switches.cc b/cc/base/switches.cc |
| index 1fb7ac98e37d6b3b87e1431a530bd25cd16a291e..277b6fccf42e9c3f538e89b858e130e507730471 100644 |
| --- a/cc/base/switches.cc |
| +++ b/cc/base/switches.cc |
| @@ -4,6 +4,8 @@ |
| #include "cc/base/switches.h" |
| +#include <string> |
| + |
| #include "base/command_line.h" |
| namespace cc { |
| @@ -36,14 +38,11 @@ const char kEnableImplSidePainting[] = "enable-impl-side-painting"; |
| const char kEnableTopControlsPositionCalculation[] = |
| "enable-top-controls-position-calculation"; |
| -// Allow heuristics to determine when a layer tile should be drawn with |
| -// the Skia GPU backend. Only valid with GPU accelerated compositing + |
| -// impl-side painting. |
| -const char kEnableGPURasterization[] = "enable-gpu-rasterization"; |
| - |
| -// Disable GPU rasterization, i.e. rasterize on the CPU only. |
| -// Overrides the kEnableGPURasterization flag. |
| -const char kDisableGPURasterization[] = "disable-gpu-rasterization"; |
| +// Select the location used for drawing layer tiles. Allowed values are |
| +// 'cpu' (rasterize on the CPU only), 'gpu' (always use the Skia GPU backend |
| +// for rasterization), and 'hybrid' (use hints and heuristics to determine |
| +// when to rasterize using the Skia GPU backend). |
| +const char kRasterizationSite[] = "rasterization-site"; |
| // The height of the movable top controls. |
| const char kTopControlsHeight[] = "top-controls-height"; |
| @@ -165,15 +164,22 @@ bool IsLCDTextEnabled() { |
| #endif |
| } |
| -bool IsGpuRasterizationEnabled() { |
| +bool IsHybridRasterizationEnabled() { |
| + if (!IsImplSidePaintingEnabled()) |
| + return false; |
| const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| + std::string rasterization_site = |
| + command_line.GetSwitchValueASCII(switches::kRasterizationSite); |
| + return rasterization_site == "hybrid"; |
| +} |
| - if (command_line.HasSwitch(switches::kDisableGPURasterization)) |
| +bool IsGpuRasterizationEnabled() { |
| + if (!IsImplSidePaintingEnabled()) |
| return false; |
|
piman
2014/03/06 22:13:53
I think all these flags and helper functions shoul
ernstm
2014/03/06 22:47:26
GPU rasterization can be enabled without setting -
|
| - else if (command_line.HasSwitch(switches::kEnableGPURasterization)) |
| - return true; |
| - |
| - return false; |
| + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| + std::string rasterization_site = |
| + command_line.GetSwitchValueASCII(switches::kRasterizationSite); |
| + return rasterization_site == "gpu"; |
| } |
| bool IsImplSidePaintingEnabled() { |