Loading gfx/thebes/gfxPrefs.h +0 −2 Original line number Diff line number Diff line Loading @@ -355,8 +355,6 @@ private: DECL_GFX_PREF(Live, "dom.vr.controller_trigger_threshold", VRControllerTriggerThreshold, float, 0.1f); DECL_GFX_PREF(Live, "dom.vr.navigation.timeout", VRNavigationTimeout, int32_t, 1000); DECL_GFX_PREF(Once, "dom.vr.oculus.enabled", VROculusEnabled, bool, true); DECL_GFX_PREF(Live, "dom.vr.oculus.present.timeout", VROculusPresentTimeout, int32_t, 10000); DECL_GFX_PREF(Live, "dom.vr.oculus.quit.timeout", VROculusQuitTimeout, int32_t, 30000); DECL_GFX_PREF(Once, "dom.vr.openvr.enabled", VROpenVREnabled, bool, false); DECL_GFX_PREF(Once, "dom.vr.osvr.enabled", VROSVREnabled, bool, false); DECL_GFX_PREF(Live, "dom.vr.poseprediction.enabled", VRPosePredictionEnabled, bool, true); Loading gfx/vr/VRManager.cpp +5 −12 Original line number Diff line number Diff line Loading @@ -264,26 +264,20 @@ VRManager::RefreshVRDisplays(bool aMustDispatch) * in the future. */ for (uint32_t i = 0; i < mManagers.Length() && displays.Length() == 0; ++i) { if (mManagers[i]->GetHMDs(displays)) { // GetHMDs returns true to indicate that no further enumeration from // other managers should be performed. This prevents erraneous // redundant enumeration of the same HMD by multiple managers. break; } mManagers[i]->GetHMDs(displays); } bool displayInfoChanged = false; bool displaySetChanged = false; if (displays.Length() != mVRDisplays.Count()) { // Catch cases where a VR display has been removed displaySetChanged = true; displayInfoChanged = true; } for (const auto& display: displays) { if (!GetDisplay(display->GetDisplayInfo().GetDisplayID())) { // This is a new display displaySetChanged = true; displayInfoChanged = true; break; } Loading @@ -294,15 +288,14 @@ VRManager::RefreshVRDisplays(bool aMustDispatch) } } // Rebuild the HashMap if there are additions or removals if (displaySetChanged) { if (displayInfoChanged) { mVRDisplays.Clear(); for (const auto& display: displays) { mVRDisplays.Put(display->GetDisplayInfo().GetDisplayID(), display); } } if (displayInfoChanged || displaySetChanged || aMustDispatch) { if (displayInfoChanged || aMustDispatch) { DispatchVRDisplayInfoUpdate(); } } Loading gfx/vr/gfxVR.h +1 −1 Original line number Diff line number Diff line Loading @@ -320,7 +320,7 @@ public: virtual void Destroy() = 0; virtual void Shutdown() = 0; virtual bool GetHMDs(nsTArray<RefPtr<VRDisplayHost>>& aHMDResult) = 0; virtual void GetHMDs(nsTArray<RefPtr<VRDisplayHost>>& aHMDResult) = 0; virtual bool GetIsPresenting() = 0; virtual void HandleInput() = 0; virtual void GetControllers(nsTArray<RefPtr<VRControllerHost>>& aControllerResult) = 0; Loading gfx/vr/gfxVROSVR.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -514,23 +514,21 @@ VRSystemManagerOSVR::Shutdown() osvr_ClientShutdown(m_ctx); } bool void VRSystemManagerOSVR::GetHMDs(nsTArray<RefPtr<VRDisplayHost>>& aHMDResult) { // make sure context, interface and display are initialized CheckOSVRStatus(); if (!Init()) { return false; return; } mHMDInfo = new VRDisplayOSVR(&m_ctx, &m_iface, &m_display); if (mHMDInfo) { aHMDResult.AppendElement(mHMDInfo); return true; } return false; } bool Loading gfx/vr/gfxVROSVR.h +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ public: static already_AddRefed<VRSystemManagerOSVR> Create(); virtual void Destroy() override; virtual void Shutdown() override; virtual bool GetHMDs(nsTArray<RefPtr<VRDisplayHost>>& aHMDResult) override; virtual void GetHMDs(nsTArray<RefPtr<VRDisplayHost>>& aHMDResult) override; virtual bool GetIsPresenting() override; virtual void HandleInput() override; virtual void GetControllers(nsTArray<RefPtr<VRControllerHost>>& Loading Loading
gfx/thebes/gfxPrefs.h +0 −2 Original line number Diff line number Diff line Loading @@ -355,8 +355,6 @@ private: DECL_GFX_PREF(Live, "dom.vr.controller_trigger_threshold", VRControllerTriggerThreshold, float, 0.1f); DECL_GFX_PREF(Live, "dom.vr.navigation.timeout", VRNavigationTimeout, int32_t, 1000); DECL_GFX_PREF(Once, "dom.vr.oculus.enabled", VROculusEnabled, bool, true); DECL_GFX_PREF(Live, "dom.vr.oculus.present.timeout", VROculusPresentTimeout, int32_t, 10000); DECL_GFX_PREF(Live, "dom.vr.oculus.quit.timeout", VROculusQuitTimeout, int32_t, 30000); DECL_GFX_PREF(Once, "dom.vr.openvr.enabled", VROpenVREnabled, bool, false); DECL_GFX_PREF(Once, "dom.vr.osvr.enabled", VROSVREnabled, bool, false); DECL_GFX_PREF(Live, "dom.vr.poseprediction.enabled", VRPosePredictionEnabled, bool, true); Loading
gfx/vr/VRManager.cpp +5 −12 Original line number Diff line number Diff line Loading @@ -264,26 +264,20 @@ VRManager::RefreshVRDisplays(bool aMustDispatch) * in the future. */ for (uint32_t i = 0; i < mManagers.Length() && displays.Length() == 0; ++i) { if (mManagers[i]->GetHMDs(displays)) { // GetHMDs returns true to indicate that no further enumeration from // other managers should be performed. This prevents erraneous // redundant enumeration of the same HMD by multiple managers. break; } mManagers[i]->GetHMDs(displays); } bool displayInfoChanged = false; bool displaySetChanged = false; if (displays.Length() != mVRDisplays.Count()) { // Catch cases where a VR display has been removed displaySetChanged = true; displayInfoChanged = true; } for (const auto& display: displays) { if (!GetDisplay(display->GetDisplayInfo().GetDisplayID())) { // This is a new display displaySetChanged = true; displayInfoChanged = true; break; } Loading @@ -294,15 +288,14 @@ VRManager::RefreshVRDisplays(bool aMustDispatch) } } // Rebuild the HashMap if there are additions or removals if (displaySetChanged) { if (displayInfoChanged) { mVRDisplays.Clear(); for (const auto& display: displays) { mVRDisplays.Put(display->GetDisplayInfo().GetDisplayID(), display); } } if (displayInfoChanged || displaySetChanged || aMustDispatch) { if (displayInfoChanged || aMustDispatch) { DispatchVRDisplayInfoUpdate(); } } Loading
gfx/vr/gfxVR.h +1 −1 Original line number Diff line number Diff line Loading @@ -320,7 +320,7 @@ public: virtual void Destroy() = 0; virtual void Shutdown() = 0; virtual bool GetHMDs(nsTArray<RefPtr<VRDisplayHost>>& aHMDResult) = 0; virtual void GetHMDs(nsTArray<RefPtr<VRDisplayHost>>& aHMDResult) = 0; virtual bool GetIsPresenting() = 0; virtual void HandleInput() = 0; virtual void GetControllers(nsTArray<RefPtr<VRControllerHost>>& aControllerResult) = 0; Loading
gfx/vr/gfxVROSVR.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -514,23 +514,21 @@ VRSystemManagerOSVR::Shutdown() osvr_ClientShutdown(m_ctx); } bool void VRSystemManagerOSVR::GetHMDs(nsTArray<RefPtr<VRDisplayHost>>& aHMDResult) { // make sure context, interface and display are initialized CheckOSVRStatus(); if (!Init()) { return false; return; } mHMDInfo = new VRDisplayOSVR(&m_ctx, &m_iface, &m_display); if (mHMDInfo) { aHMDResult.AppendElement(mHMDInfo); return true; } return false; } bool Loading
gfx/vr/gfxVROSVR.h +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ public: static already_AddRefed<VRSystemManagerOSVR> Create(); virtual void Destroy() override; virtual void Shutdown() override; virtual bool GetHMDs(nsTArray<RefPtr<VRDisplayHost>>& aHMDResult) override; virtual void GetHMDs(nsTArray<RefPtr<VRDisplayHost>>& aHMDResult) override; virtual bool GetIsPresenting() override; virtual void HandleInput() override; virtual void GetControllers(nsTArray<RefPtr<VRControllerHost>>& Loading