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 commands recorded on canvas are done in pixel aligned | |
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 { |
38 | 43 |
39 bool IsUIZeroCopyEnabled() { | 44 bool IsUIZeroCopyEnabled() { |
40 const base::CommandLine& command_line = | 45 const base::CommandLine& command_line = |
41 *base::CommandLine::ForCurrentProcess(); | 46 *base::CommandLine::ForCurrentProcess(); |
42 return command_line.HasSwitch(switches::kUIEnableZeroCopy); | 47 return command_line.HasSwitch(switches::kUIEnableZeroCopy); |
43 } | 48 } |
44 | 49 |
50 bool IsPixelCanvasRecordingEnabled() { | |
51 static const bool kIsPixelCanvasRecordingEnabled = | |
danakj
2017/07/26 16:06:04
oh, kFooBar is for compile-time constants, which t
malaykeshav
2017/07/26 18:34:45
Done
| |
52 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
53 switches::kEnablePixelCanvasRecording); | |
54 return kIsPixelCanvasRecordingEnabled; | |
55 } | |
56 | |
45 } // namespace ui | 57 } // namespace ui |
OLD | NEW |