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

Side by Side Diff: third_party/WebKit/Source/modules/vr/VRController.cpp

Issue 2309523003: Plumbing through more WebVR presentation code (Closed)
Patch Set: Addressed Michael's feedack Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "modules/vr/VRController.h" 5 #include "modules/vr/VRController.h"
6 6
7 #include "core/dom/DOMException.h" 7 #include "core/dom/DOMException.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "modules/vr/NavigatorVR.h" 10 #include "modules/vr/NavigatorVR.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 void VRController::resetPose(unsigned index) 53 void VRController::resetPose(unsigned index)
54 { 54 {
55 if (!m_service) 55 if (!m_service)
56 return; 56 return;
57 57
58 m_service->ResetPose(index); 58 m_service->ResetPose(index);
59 } 59 }
60 60
61 void VRController::requestPresent(unsigned index)
62 {
63 if (!m_service)
64 return;
65
66 m_service->RequestPresent(index);
67 }
68
69 void VRController::exitPresent(unsigned index)
70 {
71 if (!m_service)
72 return;
73
74 m_service->ExitPresent(index);
75 }
76
77 void VRController::submitFrame(unsigned index)
78 {
79 if (!m_service)
80 return;
81
82 m_service->SubmitFrame(index);
83 }
84
85 void VRController::updateLayerBounds(unsigned index,
86 device::blink::VRLayerBoundsPtr leftBounds,
87 device::blink::VRLayerBoundsPtr rightBounds)
88 {
89 if (!m_service)
90 return;
91
92 m_service->UpdateLayerBounds(index, std::move(leftBounds), std::move(rightBo unds));
93 }
94
61 VRDisplay* VRController::createOrUpdateDisplay(const device::blink::VRDisplayPtr & display) 95 VRDisplay* VRController::createOrUpdateDisplay(const device::blink::VRDisplayPtr & display)
62 { 96 {
63 VRDisplay* vrDisplay = getDisplayForIndex(display->index); 97 VRDisplay* vrDisplay = getDisplayForIndex(display->index);
64 if (!vrDisplay) { 98 if (!vrDisplay) {
65 vrDisplay = new VRDisplay(m_navigatorVR); 99 vrDisplay = new VRDisplay(m_navigatorVR);
66 m_displays.append(vrDisplay); 100 m_displays.append(vrDisplay);
67 } 101 }
68 102
69 vrDisplay->update(display); 103 vrDisplay->update(display);
70 return vrDisplay; 104 return vrDisplay;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 162
129 DEFINE_TRACE(VRController) 163 DEFINE_TRACE(VRController)
130 { 164 {
131 visitor->trace(m_navigatorVR); 165 visitor->trace(m_navigatorVR);
132 visitor->trace(m_displays); 166 visitor->trace(m_displays);
133 167
134 ContextLifecycleObserver::trace(visitor); 168 ContextLifecycleObserver::trace(visitor);
135 } 169 }
136 170
137 } // namespace blink 171 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRController.h ('k') | third_party/WebKit/Source/modules/vr/VRDisplay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698