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

Unified Diff: cc/base/switches.cc

Issue 181063022: cc: Trigger GPU rasterization based on a per-layer hint (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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..f425d7be2b05fc3b39508443a5e91cea0d04899b 100644
--- a/cc/base/switches.cc
+++ b/cc/base/switches.cc
@@ -41,8 +41,15 @@ const char kEnableTopControlsPositionCalculation[] =
// impl-side painting.
const char kEnableGPURasterization[] = "enable-gpu-rasterization";
+// Always use the Skia GPU backend for drawing layer tiles. Only valid with
+// GPU accelerated compositing + impl-side painting. Overrides the
+// kEnableGPURasterization flag.
+const char kEnableUniversalGPURasterization[] =
+ "enable-universal-gpu-rasterization";
+
// Disable GPU rasterization, i.e. rasterize on the CPU only.
-// Overrides the kEnableGPURasterization flag.
+// Overrides the kEnableGPURasterization and kEnableUniversalGPURasterization
+// flags.
const char kDisableGPURasterization[] = "disable-gpu-rasterization";
// The height of the movable top controls.
@@ -165,12 +172,28 @@ bool IsLCDTextEnabled() {
#endif
}
-bool IsGpuRasterizationEnabled() {
+bool IsHybridGpuRasterizationEnabled() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
+ if (command_line.HasSwitch(switches::kDisableGPURasterization))
+ return false;
+
+ if (command_line.HasSwitch(switches::kEnableUniversalGPURasterization))
+ return false;
+
+ if (command_line.HasSwitch(switches::kEnableGPURasterization))
+ return true;
+
+ return false;
+}
+
+bool IsUniversalGpuRasterizationEnabled() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kDisableGPURasterization))
return false;
- else if (command_line.HasSwitch(switches::kEnableGPURasterization))
+
+ if (command_line.HasSwitch(switches::kEnableUniversalGPURasterization))
return true;
return false;

Powered by Google App Engine
This is Rietveld 408576698