| 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 #include "chrome/browser/android/vr_shell/ui_scene.h" | 5 #include "chrome/browser/android/vr_shell/ui_scene.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 149 } |
| 150 | 150 |
| 151 float UiScene::GetBackgroundDistance() const { | 151 float UiScene::GetBackgroundDistance() const { |
| 152 return background_distance_; | 152 return background_distance_; |
| 153 } | 153 } |
| 154 | 154 |
| 155 bool UiScene::GetWebVrRenderingEnabled() const { | 155 bool UiScene::GetWebVrRenderingEnabled() const { |
| 156 return webvr_rendering_enabled_; | 156 return webvr_rendering_enabled_; |
| 157 } | 157 } |
| 158 | 158 |
| 159 void UiScene::SetWebVrRenderingEnabled(bool enabled) { |
| 160 webvr_rendering_enabled_ = enabled; |
| 161 } |
| 162 |
| 159 const std::vector<std::unique_ptr<UiElement>>& UiScene::GetUiElements() const { | 163 const std::vector<std::unique_ptr<UiElement>>& UiScene::GetUiElements() const { |
| 160 return ui_elements_; | 164 return ui_elements_; |
| 161 } | 165 } |
| 162 | 166 |
| 163 UiScene::UiScene() = default; | 167 UiScene::UiScene() = default; |
| 164 | 168 |
| 165 UiScene::~UiScene() = default; | 169 UiScene::~UiScene() = default; |
| 166 | 170 |
| 167 void UiScene::ApplyRecursiveTransforms(UiElement* element) { | 171 void UiScene::ApplyRecursiveTransforms(UiElement* element) { |
| 168 if (!element->dirty) | 172 if (!element->dirty) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 197 element->computed_opacity *= parent->opacity; | 201 element->computed_opacity *= parent->opacity; |
| 198 element->computed_lock_to_fov = parent->lock_to_fov; | 202 element->computed_lock_to_fov = parent->lock_to_fov; |
| 199 } | 203 } |
| 200 | 204 |
| 201 vr::MatrixMul(inheritable->to_world, transform->to_world, | 205 vr::MatrixMul(inheritable->to_world, transform->to_world, |
| 202 &transform->to_world); | 206 &transform->to_world); |
| 203 element->dirty = false; | 207 element->dirty = false; |
| 204 } | 208 } |
| 205 | 209 |
| 206 } // namespace vr_shell | 210 } // namespace vr_shell |
| OLD | NEW |