compositor_switches.cc revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
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 kUIMaxFramesPending[] = "ui-max-frames-pending";
22
23const char kUIShowPaintRects[] = "ui-show-paint-rects";
24
25bool IsUIDeadlineSchedulingEnabled() {
26  const CommandLine& command_line = *CommandLine::ForCurrentProcess();
27
28  // Default to disabled.
29  bool enabled = false;
30
31  // Default to enabled for Aura.
32  enabled = true;
33
34  // Flags override.
35  enabled |= command_line.HasSwitch(switches::kUIEnableDeadlineScheduling);
36  enabled &= !command_line.HasSwitch(switches::kUIDisableDeadlineScheduling);
37
38  return enabled;
39}
40
41}  // namespace switches
42