| 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 "chrome/browser/android/vr_shell/vr_math.h" | 12 #include "chrome/browser/android/vr_shell/vr_math.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class DictionaryValue; | 15 class DictionaryValue; |
| 16 class ListValue; | 16 class ListValue; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace vr_shell { | 19 namespace vr_shell { |
| 20 | 20 |
| 21 class Animation; | 21 class Animation; |
| 22 struct ContentRectangle; | 22 struct ContentRectangle; |
| 23 struct Transform; | |
| 24 | 23 |
| 25 class UiScene { | 24 class UiScene { |
| 26 public: | 25 public: |
| 27 enum Command { | 26 enum Command { |
| 28 ADD_ELEMENT, | 27 ADD_ELEMENT, |
| 29 UPDATE_ELEMENT, | 28 UPDATE_ELEMENT, |
| 30 REMOVE_ELEMENT, | 29 REMOVE_ELEMENT, |
| 31 ADD_ANIMATION, | 30 ADD_ANIMATION, |
| 32 REMOVE_ANIMATION, | 31 REMOVE_ANIMATION, |
| 33 CONFIGURE_SCENE, | 32 CONFIGURE_SCENE, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 70 |
| 72 std::vector<const ContentRectangle*> GetWorldElements() const; | 71 std::vector<const ContentRectangle*> GetWorldElements() const; |
| 73 std::vector<const ContentRectangle*> GetHeadLockedElements() const; | 72 std::vector<const ContentRectangle*> GetHeadLockedElements() const; |
| 74 bool HasVisibleHeadLockedElements() const; | 73 bool HasVisibleHeadLockedElements() const; |
| 75 | 74 |
| 76 const Colorf& GetBackgroundColor() const; | 75 const Colorf& GetBackgroundColor() const; |
| 77 float GetBackgroundDistance() const; | 76 float GetBackgroundDistance() const; |
| 78 bool GetWebVrRenderingEnabled() const; | 77 bool GetWebVrRenderingEnabled() const; |
| 79 | 78 |
| 80 private: | 79 private: |
| 81 void ApplyRecursiveTransforms(const ContentRectangle& element, | 80 void ApplyRecursiveTransforms(ContentRectangle* element); |
| 82 Transform* transform, | |
| 83 float* opacity, | |
| 84 bool* lock_to_fov); | |
| 85 void ApplyDictToElement(const base::DictionaryValue& dict, | 81 void ApplyDictToElement(const base::DictionaryValue& dict, |
| 86 ContentRectangle* element); | 82 ContentRectangle* element); |
| 87 | 83 |
| 88 std::vector<std::unique_ptr<ContentRectangle>> ui_elements_; | 84 std::vector<std::unique_ptr<ContentRectangle>> ui_elements_; |
| 89 ContentRectangle* content_element_ = nullptr; | 85 ContentRectangle* content_element_ = nullptr; |
| 90 Colorf background_color_ = {0.1f, 0.1f, 0.1f, 1.0f}; | 86 Colorf background_color_ = {0.1f, 0.1f, 0.1f, 1.0f}; |
| 91 float background_distance_ = 10.0f; | 87 float background_distance_ = 10.0f; |
| 92 bool webvr_rendering_enabled_ = true; | 88 bool webvr_rendering_enabled_ = true; |
| 93 | 89 |
| 94 DISALLOW_COPY_AND_ASSIGN(UiScene); | 90 DISALLOW_COPY_AND_ASSIGN(UiScene); |
| 95 }; | 91 }; |
| 96 | 92 |
| 97 } // namespace vr_shell | 93 } // namespace vr_shell |
| 98 | 94 |
| 99 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ | 95 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ |
| OLD | NEW |