| 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 kUIEnableRGBA4444Textures[] = "ui-enable-rgba-4444-textures"; |
| 24 |
| 23 const char kUIEnableZeroCopy[] = "ui-enable-zero-copy"; | 25 const char kUIEnableZeroCopy[] = "ui-enable-zero-copy"; |
| 24 | 26 |
| 25 const char kUIShowPaintRects[] = "ui-show-paint-rects"; | 27 const char kUIShowPaintRects[] = "ui-show-paint-rects"; |
| 26 | 28 |
| 27 } // namespace switches | 29 } // namespace switches |
| 28 | 30 |
| 29 namespace ui { | 31 namespace ui { |
| 30 | 32 |
| 31 bool IsUIZeroCopyEnabled() { | 33 bool IsUIZeroCopyEnabled() { |
| 32 const base::CommandLine& command_line = | 34 const base::CommandLine& command_line = |
| 33 *base::CommandLine::ForCurrentProcess(); | 35 *base::CommandLine::ForCurrentProcess(); |
| 34 return command_line.HasSwitch(switches::kUIEnableZeroCopy); | 36 return command_line.HasSwitch(switches::kUIEnableZeroCopy); |
| 35 } | 37 } |
| 36 | 38 |
| 37 bool IsUIOneCopyEnabled() { | 39 bool IsUIOneCopyEnabled() { |
| 38 // One-copy is on by default unless zero copy is enabled. | 40 // One-copy is on by default unless zero copy is enabled. |
| 39 return !IsUIZeroCopyEnabled(); | 41 return !IsUIZeroCopyEnabled(); |
| 40 } | 42 } |
| 41 | 43 |
| 42 } // namespace ui | 44 } // namespace ui |
| OLD | NEW |