Chromium Code Reviews| Index: ui/compositor/compositor_switches.cc |
| diff --git a/ui/compositor/compositor_switches.cc b/ui/compositor/compositor_switches.cc |
| index 2a999a81a5094f05a9ba629feafdf8220f444ed4..9cbb8febcb4107a15090d483daea5d067d834bcb 100644 |
| --- a/ui/compositor/compositor_switches.cc |
| +++ b/ui/compositor/compositor_switches.cc |
| @@ -28,9 +28,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 |
| +// measurements. This also enables scaling of all elements in views and layers |
| +// to be done via corner points. See go/pixel-canvas |
|
vmpstr
2017/07/11 17:37:21
can you use a public link shortener (like goo.gl)
malaykeshav
2017/07/12 00:55:35
Done
|
| +const char kEnablePixelCanvasRecording[] = "enable-pixel-canvas-recording"; |
| + |
| } // namespace switches |
| namespace ui { |
| +namespace { |
| +bool kEnablePixelCanvasForTesting = false; |
| +} |
| bool IsUIZeroCopyEnabled() { |
| const base::CommandLine& command_line = |
| @@ -38,4 +46,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) { |
|
vmpstr
2017/07/11 17:37:21
I think this function should be called EnablePixel
malaykeshav
2017/07/12 00:55:35
During unittests, the switch is disabled, so kIsPi
|
| + kEnablePixelCanvasForTesting = value; |
| +} |
| + |
| } // namespace ui |