compositor_switches.cc revision 68043e1e95eeb07d5cae7aca370b26518b0867d6
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
3// found in the LICENSE file.
4
5#include "ui/compositor/compositor_switches.h"
6
7#include "base/command_line.h"
8
9namespace switches {
10
11const char kDisableTestCompositor[] = "disable-test-compositor";
12
13const char kUIDisableDeadlineScheduling[] = "ui-disable-deadline-scheduling";
14
15const char kUIDisableThreadedCompositing[] = "ui-disable-threaded-compositing";
16
17const char kUIEnableDeadlineScheduling[] = "ui-enable-deadline-scheduling";
18
19const char kUIEnableSoftwareCompositing[] = "ui-enable-software-compositing";
20
21const char kUIEnableThreadedCompositing[] = "ui-enable-threaded-compositing";
22
23const char kUIMaxFramesPending[] = "ui-max-frames-pending";
24
25const char kUIShowPaintRects[] = "ui-show-paint-rects";
26
27bool IsUIDeadlineSchedulingEnabled() {
28  const CommandLine& command_line = *CommandLine::ForCurrentProcess();
29
30  // Default to disabled.
31  bool enabled = false;
32
33  // Flags override.
34  enabled |= command_line.HasSwitch(switches::kUIEnableDeadlineScheduling);
35  enabled &= !command_line.HasSwitch(switches::kUIDisableDeadlineScheduling);
36
37  return enabled;
38}
39
40}  // namespace switches
41