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

Unified Diff: third_party/WebKit/Source/modules/vr/VRController.cpp

Issue 2668003003: Provide WebVR pose data only to the focused frame. (Closed)
Patch Set: Address comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/vr/VRController.cpp
diff --git a/third_party/WebKit/Source/modules/vr/VRController.cpp b/third_party/WebKit/Source/modules/vr/VRController.cpp
index 0df41d123929b8776bdb9a749274202c3f2677af..028834ba218097cc143015c0104c078f9910326c 100644
--- a/third_party/WebKit/Source/modules/vr/VRController.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRController.cpp
@@ -64,6 +64,7 @@ void VRController::OnDisplayConnected(
new VRDisplay(m_navigatorVR, std::move(display), std::move(request));
vrDisplay->update(displayInfo);
vrDisplay->onConnected();
+ vrDisplay->focusChanged();
m_displays.push_back(vrDisplay);
if (m_displays.size() == m_numberOfSyncedDisplays) {
@@ -72,6 +73,11 @@ void VRController::OnDisplayConnected(
}
}
+void VRController::focusChanged() {
+ for (const auto& display : m_displays)
+ display->focusChanged();
+}
+
// Called when the VRService has called OnDisplayConnected for all active
// VRDisplays.
void VRController::onDisplaysSynced(unsigned numberOfDisplays) {
@@ -101,8 +107,8 @@ void VRController::dispose() {
m_binding.Close();
// Shutdown all displays' message pipe
- for (size_t i = 0; i < m_displays.size(); ++i)
- m_displays[i]->dispose();
+ for (const auto& display : m_displays)
+ display->dispose();
m_displays.clear();
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRController.h ('k') | third_party/WebKit/Source/modules/vr/VRDisplay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698