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

Side by Side Diff: chrome/browser/android/vr_shell/ui_scene.cc

Issue 2833773005: Pause drawing webvr when the App button is pressed (Closed)
Patch Set: refactor 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 unified diff | Download patch
OLDNEW
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 152
153 float UiScene::GetBackgroundDistance() const { 153 float UiScene::GetBackgroundDistance() const {
154 return background_distance_; 154 return background_distance_;
155 } 155 }
156 156
157 bool UiScene::GetWebVrRenderingEnabled() const { 157 bool UiScene::GetWebVrRenderingEnabled() const {
158 return webvr_rendering_enabled_; 158 return webvr_rendering_enabled_;
159 } 159 }
160 160
161 void UiScene::SetWebVrRenderingEnabled(bool enabled) {
162 webvr_rendering_enabled_ = enabled;
163 }
164
161 const std::vector<std::unique_ptr<UiElement>>& UiScene::GetUiElements() const { 165 const std::vector<std::unique_ptr<UiElement>>& UiScene::GetUiElements() const {
162 return ui_elements_; 166 return ui_elements_;
163 } 167 }
164 168
165 UiScene::UiScene() = default; 169 UiScene::UiScene() = default;
166 170
167 UiScene::~UiScene() = default; 171 UiScene::~UiScene() = default;
168 172
169 void UiScene::ApplyRecursiveTransforms(UiElement* element) { 173 void UiScene::ApplyRecursiveTransforms(UiElement* element) {
170 if (!element->dirty) 174 if (!element->dirty)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 211
208 // TODO(mthiesse): Move this to UiSceneManager. 212 // TODO(mthiesse): Move this to UiSceneManager.
209 void UiScene::OnGLInitialized() { 213 void UiScene::OnGLInitialized() {
210 gl_initialized_ = true; 214 gl_initialized_ = true;
211 for (const std::unique_ptr<UiElement>& element : ui_elements_) { 215 for (const std::unique_ptr<UiElement>& element : ui_elements_) {
212 element->Initialize(); 216 element->Initialize();
213 } 217 }
214 } 218 }
215 219
216 } // namespace vr_shell 220 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698