Index: ui/compositor/compositor_switches.cc |
diff --git a/ui/compositor/compositor_switches.cc b/ui/compositor/compositor_switches.cc |
index 991aba5e0ef1b54462bd01258d1991601f1d7db1..4f72005edd44b1249e269da1a75e83f3e7c6a26c 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 commnads recorded on canvas are done in pixel aligned |
danakj
2017/07/19 17:00:59
commands
malaykeshav
2017/07/21 00:12:33
Done
|
+// 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; |
+} |
bool IsUIZeroCopyEnabled() { |
const base::CommandLine& command_line = |
@@ -42,4 +50,15 @@ bool IsUIZeroCopyEnabled() { |
return command_line.HasSwitch(switches::kUIEnableZeroCopy); |
} |
+bool IsPixelCanvasRecordingEnabled() { |
+ static const bool kIsPixelCanvasRecordingEnabled = |
+ base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnablePixelCanvasRecording); |
+ return kIsPixelCanvasRecordingEnabled || kEnablePixelCanvasForTesting; |
+} |
+ |
+void SetPixelCanvasForTesting(bool value) { |
+ kEnablePixelCanvasForTesting = value; |
+} |
+ |
} // namespace ui |