Bug 1592713 - Avoid to update VR HMD sensor states when pages are not in the presenting mode. r=kip

Differential Revision: https://phabricator.services.mozilla.com/D51288

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Daosheng Mu 2019-10-31 22:10:43 +00:00
Родитель 4114aeff1a
Коммит 681b4117d9
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -393,7 +393,10 @@ void VRDisplay::UpdateFrameInfo() {
* If we are not presenting WebVR content, the frame will never end and we * If we are not presenting WebVR content, the frame will never end and we
* should return the latest frame data always. * should return the latest frame data always.
*/ */
if (mFrameInfo.IsDirty() || !mPresentation) { mFrameInfo.Clear();
if ( (mFrameInfo.IsDirty() && IsPresenting()) ||
mClient->GetDisplayInfo().GetPresentingGroups() == 0) {
const gfx::VRHMDSensorState& state = mClient->GetSensorState(); const gfx::VRHMDSensorState& state = mClient->GetSensorState();
const gfx::VRDisplayInfo& info = mClient->GetDisplayInfo(); const gfx::VRDisplayInfo& info = mClient->GetDisplayInfo();
mFrameInfo.Update(info, state, mDepthNear, mDepthFar); mFrameInfo.Update(info, state, mDepthNear, mDepthFar);