| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h" | 13 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h" |
| 14 #include "device/vr/vr_types.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class ListValue; | 17 class ListValue; |
| 18 class TimeTicks; | 18 class TimeTicks; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace vr_shell { | 21 namespace vr_shell { |
| 22 | 22 |
| 23 class Animation; | 23 class Animation; |
| 24 class UiElement; | 24 class UiElement; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 const std::vector<std::unique_ptr<UiElement>>& GetUiElements() const; | 59 const std::vector<std::unique_ptr<UiElement>>& GetUiElements() const; |
| 60 | 60 |
| 61 UiElement* GetUiElementById(int element_id) const; | 61 UiElement* GetUiElementById(int element_id) const; |
| 62 UiElement* GetUiElementByDebugId(UiElementDebugId debug_id) const; | 62 UiElement* GetUiElementByDebugId(UiElementDebugId debug_id) const; |
| 63 | 63 |
| 64 std::vector<const UiElement*> GetWorldElements() const; | 64 std::vector<const UiElement*> GetWorldElements() const; |
| 65 std::vector<const UiElement*> GetOverlayElements() const; | 65 std::vector<const UiElement*> GetOverlayElements() const; |
| 66 std::vector<const UiElement*> GetHeadLockedElements() const; | 66 std::vector<const UiElement*> GetHeadLockedElements() const; |
| 67 bool HasVisibleHeadLockedElements() const; | 67 bool HasVisibleHeadLockedElements() const; |
| 68 | 68 |
| 69 void SetBackgroundColor(const vr::Colorf& color); | 69 void SetBackgroundColor(const SkColor& color); |
| 70 const vr::Colorf& GetBackgroundColor() const; | 70 const SkColor& GetBackgroundColor() const; |
| 71 void SetBackgroundDistance(float distance); | 71 void SetBackgroundDistance(float distance); |
| 72 float GetBackgroundDistance() const; | 72 float GetBackgroundDistance() const; |
| 73 | 73 |
| 74 bool GetWebVrRenderingEnabled() const; | 74 bool GetWebVrRenderingEnabled() const; |
| 75 void SetWebVrRenderingEnabled(bool enabled); | 75 void SetWebVrRenderingEnabled(bool enabled); |
| 76 | 76 |
| 77 bool is_exiting() const { return is_exiting_; } | 77 bool is_exiting() const { return is_exiting_; } |
| 78 void set_is_exiting(); | 78 void set_is_exiting(); |
| 79 | 79 |
| 80 void OnGLInitialized(); | 80 void OnGLInitialized(); |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 void Animate(const base::TimeTicks& current_time); | 83 void Animate(const base::TimeTicks& current_time); |
| 84 void ApplyRecursiveTransforms(UiElement* element); | 84 void ApplyRecursiveTransforms(UiElement* element); |
| 85 | 85 |
| 86 std::vector<std::unique_ptr<UiElement>> ui_elements_; | 86 std::vector<std::unique_ptr<UiElement>> ui_elements_; |
| 87 UiElement* content_element_ = nullptr; | 87 UiElement* content_element_ = nullptr; |
| 88 vr::Colorf background_color_ = {0.1f, 0.1f, 0.1f, 1.0f}; | 88 SkColor background_color_ = 0xFF1A1A1A; |
| 89 float background_distance_ = 10.0f; | 89 float background_distance_ = 10.0f; |
| 90 bool webvr_rendering_enabled_ = true; | 90 bool webvr_rendering_enabled_ = true; |
| 91 bool gl_initialized_ = false; | 91 bool gl_initialized_ = false; |
| 92 bool is_exiting_ = false; | 92 bool is_exiting_ = false; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(UiScene); | 94 DISALLOW_COPY_AND_ASSIGN(UiScene); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace vr_shell | 97 } // namespace vr_shell |
| 98 | 98 |
| 99 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ | 99 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ |
| OLD | NEW |