Chromium Code Reviews| Index: chrome/browser/android/vr_shell/ui_scene.cc |
| diff --git a/chrome/browser/android/vr_shell/ui_scene.cc b/chrome/browser/android/vr_shell/ui_scene.cc |
| index 9982c988caa67049f2618b565fb6d773284eb320..d263686139409b8dc15a89a40ec8658e2075113e 100644 |
| --- a/chrome/browser/android/vr_shell/ui_scene.cc |
| +++ b/chrome/browser/android/vr_shell/ui_scene.cc |
| @@ -62,6 +62,8 @@ void UiScene::AddUiElement(std::unique_ptr<UiElement> element) { |
| CHECK_EQ(element->x_anchoring, XAnchoring::XNONE); |
| CHECK_EQ(element->y_anchoring, YAnchoring::YNONE); |
| } |
| + if (gl_initialized_) |
| + element->Initialize(); |
| ui_elements_.push_back(std::move(element)); |
| } |
| @@ -203,4 +205,11 @@ void UiScene::ApplyRecursiveTransforms(UiElement* element) { |
| element->dirty = false; |
| } |
| +void UiScene::OnGLInitialized() { |
| + gl_initialized_ = true; |
| + for (const auto& element : ui_elements_) { |
|
cjgrant
2017/04/21 14:30:13
This is another situation where the const should b
mthiesse
2017/04/21 15:05:12
No, because the unique_ptr is constant, but -> doe
cjgrant
2017/04/21 15:19:33
Right. I mean that we shouldn't bother with the c
mthiesse
2017/04/21 17:17:30
Fixed by getting rid of auto so it's not confusing
|
| + element->Initialize(); |
| + } |
| +} |
| + |
| } // namespace vr_shell |