Bug 1318468 - Update VR controller inputs on every VR Vsync rather than every 2D vsync
MozReview-Commit-ID: ICuIw4e56VC
--- a/gfx/vr/VRManager.cpp
+++ b/gfx/vr/VRManager.cpp
@@ -176,19 +176,16 @@ VRManager::NotifyVsync(const TimeStamp&
}
for (auto iter = mVRDisplays.Iter(); !iter.Done(); iter.Next()) {
gfx::VRDisplayHost* display = iter.UserData();
display->NotifyVSync();
}
if (bHaveEventListener) {
- for (uint32_t i = 0; i < mControllerManagers.Length(); ++i) {
- mControllerManagers[i]->HandleInput();
- }
// If content has set an EventHandler to be notified of VR display events
// we must continually refresh the VR display enumeration to check
// for events that we must fire such as Window.onvrdisplayconnect
// Note that enumeration itself may activate display hardware, such
// as Oculus, so we only do this when we know we are displaying content
// that is looking for VR displays.
if (mLastRefreshTime.IsNull()) {
// This is the first vsync, must refresh VR displays
@@ -206,16 +203,19 @@ VRManager::NotifyVsync(const TimeStamp&
}
}
}
}
void
VRManager::NotifyVRVsync(const uint32_t& aDisplayID)
{
+ for (uint32_t i = 0; i < mControllerManagers.Length(); ++i) {
+ mControllerManagers[i]->HandleInput();
+ }
for (auto iter = mVRManagerParents.Iter(); !iter.Done(); iter.Next()) {
Unused << iter.Get()->GetKey()->SendNotifyVRVSync(aDisplayID);
}
}
void
VRManager::RefreshVRDisplays(bool aMustDispatch)
{