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

Unified Diff: cc/base/switches.cc

Issue 184573002: Use MSAA in GPU rasterization if Skia suggests it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: the hunk, actually Created 6 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
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();

Powered by Google App Engine
This is Rietveld 408576698