Index: cc/base/switches.cc |
diff --git a/cc/base/switches.cc b/cc/base/switches.cc |
index 1fb7ac98e37d6b3b87e1431a530bd25cd16a291e..a73a774d4e80697fda8b4375fb6366e166aabc9b 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 { |
@@ -37,8 +39,9 @@ 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. |
+// a Skia GPU backend. The backend can be selected explicitly by |
+// appending "={gpu,msaa4,msaa16}". |
+// 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. |
@@ -176,6 +179,19 @@ bool IsGpuRasterizationEnabled() { |
return false; |
} |
+GpuRasterizationType GetGpuRasterizationType() { |
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ |
+ std::string type = |
+ command_line.GetSwitchValueASCII(switches::kEnableGPURasterization); |
+ if (type == "msaa4") |
+ return GpuRasterizationMsaa4; |
+ else if (type == "msaa16") |
+ return GpuRasterizationMsaa4; |
+ |
+ return GpuRasterizationGpu; |
+} |
+ |
bool IsImplSidePaintingEnabled() { |
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |