| Index: sky/viewer/runtime_flags.cc
|
| diff --git a/sky/viewer/runtime_flags.cc b/sky/viewer/runtime_flags.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e1ec15a80ce21bf9ab1717edae8a5dc4fba33168
|
| --- /dev/null
|
| +++ b/sky/viewer/runtime_flags.cc
|
| @@ -0,0 +1,32 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "sky/viewer/runtime_flags.h"
|
| +
|
| +#include "base/logging.h"
|
| +#include "mojo/public/cpp/application/application_impl.h"
|
| +
|
| +namespace sky {
|
| +namespace {
|
| +
|
| +bool initialized = false;
|
| +RuntimeFlags flags;
|
| +
|
| +// Load the viewer in testing mode so we can dump pixels.
|
| +const char kTesting[] = "--testing";
|
| +
|
| +} // namespace
|
| +
|
| +void RuntimeFlags::Initialize(mojo::ApplicationImpl* app) {
|
| + DCHECK(!initialized);
|
| + flags.testing = app->HasArg(kTesting);
|
| + initialized = true;
|
| +}
|
| +
|
| +const RuntimeFlags& RuntimeFlags::Get() {
|
| + DCHECK(initialized);
|
| + return flags;
|
| +}
|
| +
|
| +} // namespace sky
|
|
|