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 |
11 // Enable compositing individual elements via hardware overlays when | 11 // Enable compositing individual elements via hardware overlays when |
12 // permitted by device. | 12 // permitted by device. |
13 const char kEnableHardwareOverlays[] = "enable-hardware-overlays"; | 13 const char kEnableHardwareOverlays[] = "enable-hardware-overlays"; |
14 | 14 |
15 // Forces tests to produce pixel output when they normally wouldn't. | 15 // Forces tests to produce pixel output when they normally wouldn't. |
16 const char kEnablePixelOutputInTests[] = "enable-pixel-output-in-tests"; | 16 const char kEnablePixelOutputInTests[] = "enable-pixel-output-in-tests"; |
17 | 17 |
18 const char kUIDisableThreadedCompositing[] = "ui-disable-threaded-compositing"; | 18 const char kUIDisableThreadedCompositing[] = "ui-disable-threaded-compositing"; |
19 | 19 |
20 const char kUIEnableCompositorAnimationTimelines[] = | 20 const char kUIEnableCompositorAnimationTimelines[] = |
21 "ui-enable-compositor-animation-timelines"; | 21 "ui-enable-compositor-animation-timelines"; |
22 | 22 |
23 const char kUIEnableImplSidePainting[] = "ui-enable-impl-side-painting"; | 23 const char kUIDisableImplSidePainting[] = "ui-disable-impl-side-painting"; |
24 | 24 |
25 const char kUIDisableSlimmingPaint[] = "ui-disable-slimming-paint"; | 25 const char kUIDisableSlimmingPaint[] = "ui-disable-slimming-paint"; |
26 | 26 |
27 const char kUIEnableZeroCopy[] = "ui-enable-zero-copy"; | 27 const char kUIEnableZeroCopy[] = "ui-enable-zero-copy"; |
28 | 28 |
29 const char kUIShowPaintRects[] = "ui-show-paint-rects"; | 29 const char kUIShowPaintRects[] = "ui-show-paint-rects"; |
30 | 30 |
31 } // namespace switches | 31 } // namespace switches |
32 | 32 |
33 namespace ui { | 33 namespace ui { |
34 | 34 |
35 bool IsUIImplSidePaintingEnabled() { | 35 bool IsUIImplSidePaintingEnabled() { |
36 const base::CommandLine& command_line = | 36 const base::CommandLine& command_line = |
37 *base::CommandLine::ForCurrentProcess(); | 37 *base::CommandLine::ForCurrentProcess(); |
38 return command_line.HasSwitch(switches::kUIEnableImplSidePainting); | 38 |
| 39 return !command_line.HasSwitch(switches::kUIDisableImplSidePainting); |
39 } | 40 } |
40 | 41 |
41 bool IsUIZeroCopyEnabled() { | 42 bool IsUIZeroCopyEnabled() { |
42 const base::CommandLine& command_line = | 43 const base::CommandLine& command_line = |
43 *base::CommandLine::ForCurrentProcess(); | 44 *base::CommandLine::ForCurrentProcess(); |
44 return command_line.HasSwitch(switches::kUIEnableZeroCopy); | 45 return command_line.HasSwitch(switches::kUIEnableZeroCopy); |
45 } | 46 } |
46 | 47 |
47 bool IsUIOneCopyEnabled() { | 48 bool IsUIOneCopyEnabled() { |
48 // One-copy is on by default unless zero copy is enabled. | 49 // One-copy is on by default unless zero copy is enabled. |
49 return !IsUIZeroCopyEnabled(); | 50 return !IsUIZeroCopyEnabled(); |
50 } | 51 } |
51 | 52 |
52 bool IsUISlimmingPaintEnabled() { | 53 bool IsUISlimmingPaintEnabled() { |
53 const base::CommandLine& command_line = | 54 const base::CommandLine& command_line = |
54 *base::CommandLine::ForCurrentProcess(); | 55 *base::CommandLine::ForCurrentProcess(); |
55 return !command_line.HasSwitch(switches::kUIDisableSlimmingPaint); | 56 return !command_line.HasSwitch(switches::kUIDisableSlimmingPaint); |
56 } | 57 } |
57 | 58 |
58 } // namespace ui | 59 } // namespace ui |
OLD | NEW |