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 14 matching lines...) Expand all Loading... | |
25 const char kUIDisablePartialSwap[] = "ui-disable-partial-swap"; | 25 const char kUIDisablePartialSwap[] = "ui-disable-partial-swap"; |
26 | 26 |
27 const char kUIEnableRGBA4444Textures[] = "ui-enable-rgba-4444-textures"; | 27 const char kUIEnableRGBA4444Textures[] = "ui-enable-rgba-4444-textures"; |
28 | 28 |
29 const char kUIEnableZeroCopy[] = "ui-enable-zero-copy"; | 29 const char kUIEnableZeroCopy[] = "ui-enable-zero-copy"; |
30 | 30 |
31 const char kUIShowPaintRects[] = "ui-show-paint-rects"; | 31 const char kUIShowPaintRects[] = "ui-show-paint-rects"; |
32 | 32 |
33 const char kUISlowAnimations[] = "ui-slow-animations"; | 33 const char kUISlowAnimations[] = "ui-slow-animations"; |
34 | 34 |
35 // 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
| |
36 // measurements. This also enables scaling of all elements in views and layers | |
37 // to be done via corner points. See https://goo.gl/Dqig5s | |
38 const char kEnablePixelCanvasRecording[] = "enable-pixel-canvas-recording"; | |
39 | |
35 } // namespace switches | 40 } // namespace switches |
36 | 41 |
37 namespace ui { | 42 namespace ui { |
43 namespace { | |
44 bool kEnablePixelCanvasForTesting = false; | |
45 } | |
38 | 46 |
39 bool IsUIZeroCopyEnabled() { | 47 bool IsUIZeroCopyEnabled() { |
40 const base::CommandLine& command_line = | 48 const base::CommandLine& command_line = |
41 *base::CommandLine::ForCurrentProcess(); | 49 *base::CommandLine::ForCurrentProcess(); |
42 return command_line.HasSwitch(switches::kUIEnableZeroCopy); | 50 return command_line.HasSwitch(switches::kUIEnableZeroCopy); |
43 } | 51 } |
44 | 52 |
53 bool IsPixelCanvasRecordingEnabled() { | |
54 static const bool kIsPixelCanvasRecordingEnabled = | |
55 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
56 switches::kEnablePixelCanvasRecording); | |
57 return kIsPixelCanvasRecordingEnabled || kEnablePixelCanvasForTesting; | |
58 } | |
59 | |
60 void SetPixelCanvasForTesting(bool value) { | |
61 kEnablePixelCanvasForTesting = value; | |
62 } | |
63 | |
45 } // namespace ui | 64 } // namespace ui |
OLD | NEW |