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

Unified Diff: ui/compositor/compositor_switches.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Unittest update Created 3 years, 5 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: ui/compositor/compositor_switches.cc
diff --git a/ui/compositor/compositor_switches.cc b/ui/compositor/compositor_switches.cc
index 991aba5e0ef1b54462bd01258d1991601f1d7db1..b5d15e3c209bea951f89d832630df03d601c2820 100644
--- a/ui/compositor/compositor_switches.cc
+++ b/ui/compositor/compositor_switches.cc
@@ -32,9 +32,17 @@ const char kUIShowPaintRects[] = "ui-show-paint-rects";
const char kUISlowAnimations[] = "ui-slow-animations";
+// If enabled, all draw commands recorded on canvas are done in pixel aligned
+// measurements. This also enables scaling of all elements in views and layers
+// to be done via corner points. See https://goo.gl/Dqig5s
+const char kEnablePixelCanvasRecording[] = "enable-pixel-canvas-recording";
+
} // namespace switches
namespace ui {
+namespace {
+bool kEnablePixelCanvasForTesting = false;
danakj 2017/07/25 17:58:56 remove
malaykeshav 2017/07/25 22:57:57 Done
+}
bool IsUIZeroCopyEnabled() {
const base::CommandLine& command_line =
@@ -42,4 +50,11 @@ bool IsUIZeroCopyEnabled() {
return command_line.HasSwitch(switches::kUIEnableZeroCopy);
}
+bool IsPixelCanvasRecordingEnabled() {
+ static const bool kIsPixelCanvasRecordingEnabled =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnablePixelCanvasRecording);
+ return kIsPixelCanvasRecordingEnabled || kEnablePixelCanvasForTesting;
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698