Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: sky/viewer/runtime_flags.cc

Issue 854303002: Sky should use an SkPicture when drawing (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fixes Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..c9303e0c7145ce16b795b2088582eb0a0c0ca160
--- /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

Powered by Google App Engine
This is Rietveld 408576698