OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/compositor/compositor_switches.h" | 5 #include "ui/compositor/compositor_switches.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 | 8 |
9 namespace switches { | 9 namespace switches { |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... | |
21 const char kUIDisablePartialSwap[] = "ui-disable-partial-swap"; | 21 const char kUIDisablePartialSwap[] = "ui-disable-partial-swap"; |
22 | 22 |
23 const char kUIEnableRGBA4444Textures[] = "ui-enable-rgba-4444-textures"; | 23 const char kUIEnableRGBA4444Textures[] = "ui-enable-rgba-4444-textures"; |
24 | 24 |
25 const char kUIEnableZeroCopy[] = "ui-enable-zero-copy"; | 25 const char kUIEnableZeroCopy[] = "ui-enable-zero-copy"; |
26 | 26 |
27 const char kUIShowPaintRects[] = "ui-show-paint-rects"; | 27 const char kUIShowPaintRects[] = "ui-show-paint-rects"; |
28 | 28 |
29 const char kUISlowAnimations[] = "ui-slow-animations"; | 29 const char kUISlowAnimations[] = "ui-slow-animations"; |
30 | 30 |
31 // If enabled, all draw commnads recorded on canvas are done in pixel aligned | |
32 // measurements. This also enables scaling of all elements in views and layers | |
33 // 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
| |
34 const char kEnablePixelCanvasRecording[] = "enable-pixel-canvas-recording"; | |
35 | |
31 } // namespace switches | 36 } // namespace switches |
32 | 37 |
33 namespace ui { | 38 namespace ui { |
39 namespace { | |
40 bool kEnablePixelCanvasForTesting = false; | |
41 } | |
34 | 42 |
35 bool IsUIZeroCopyEnabled() { | 43 bool IsUIZeroCopyEnabled() { |
36 const base::CommandLine& command_line = | 44 const base::CommandLine& command_line = |
37 *base::CommandLine::ForCurrentProcess(); | 45 *base::CommandLine::ForCurrentProcess(); |
38 return command_line.HasSwitch(switches::kUIEnableZeroCopy); | 46 return command_line.HasSwitch(switches::kUIEnableZeroCopy); |
39 } | 47 } |
40 | 48 |
49 bool IsPixelCanvasRecordingEnabled() { | |
50 static const bool kIsPixelCanvasRecordingEnabled = | |
51 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
52 switches::kEnablePixelCanvasRecording); | |
53 return kIsPixelCanvasRecordingEnabled || kEnablePixelCanvasForTesting; | |
54 } | |
55 | |
56 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
| |
57 kEnablePixelCanvasForTesting = value; | |
58 } | |
59 | |
41 } // namespace ui | 60 } // namespace ui |
OLD | NEW |