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

Unified Diff: chrome/browser/android/vr_shell/color_scheme.cc

Issue 2905013002: [vr] Introduce ColorScheme (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « chrome/browser/android/vr_shell/color_scheme.h ('k') | chrome/browser/android/vr_shell/ui_scene_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/color_scheme.cc
diff --git a/chrome/browser/android/vr_shell/color_scheme.cc b/chrome/browser/android/vr_shell/color_scheme.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a662ed84add6dfb669d28dd9ce23fc165f5e825e
--- /dev/null
+++ b/chrome/browser/android/vr_shell/color_scheme.cc
@@ -0,0 +1,40 @@
+// Copyright 2017 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 "chrome/browser/android/vr_shell/color_scheme.h"
+
+namespace vr_shell {
+
+namespace {
+
+static ColorScheme kColorSchemes[ColorScheme::kNumModes];
+
+void InitializeColorSchemes() {
+ static bool initialized = false;
+ if (initialized)
+ return;
+
+ ColorScheme& normal_scheme = kColorSchemes[ColorScheme::kModeNormal];
+ normal_scheme.horizon = {0.89, 0.89, 0.89, 1.0};
+ normal_scheme.floor = {0.811, 0.811, 0.811, 1.0};
+ normal_scheme.ceiling = {0.859, 0.859, 0.859, 1.0};
+ normal_scheme.floor_grid = {1.0, 1.0, 1.0, 1.0};
+
+ ColorScheme& fullscreen_scheme = kColorSchemes[ColorScheme::kModeFullscreen];
+ fullscreen_scheme.horizon = {0.039215686, 0.0, 0.082352941, 1.0};
+ fullscreen_scheme.floor = {0.02745098, 0.058823529, 0.109803922, 1.0};
+ fullscreen_scheme.ceiling = {0.015686275, 0.031372549, 0.058823529, 1.0};
+ fullscreen_scheme.floor_grid = {0.639215686, 0.878431373, 1.0, 0.5};
+
+ initialized = true;
+}
+
+} // namespace
+
+const ColorScheme& ColorScheme::GetColorScheme(ColorScheme::Mode mode) {
+ InitializeColorSchemes();
+ return kColorSchemes[static_cast<int>(mode)];
+}
+
+} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/color_scheme.h ('k') | chrome/browser/android/vr_shell/ui_scene_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698