From a3e06efc18289b0bc73ff2a2cde6362054f46a5c Mon Sep 17 00:00:00 2001 From: Imanol Fernandez Date: Thu, 21 Mar 2019 19:38:18 +0000 Subject: [PATCH] Bug 1537899 - Add neck model capability for VRPose position. r=kip Add neck model capability for VRPose position. Differential Revision: https://phabricator.services.mozilla.com/D24386 --HG-- extra : moz-landing-system : lando --- dom/vr/VRDisplay.cpp | 4 +++- gfx/vr/external_api/moz_external_vr.h | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dom/vr/VRDisplay.cpp b/dom/vr/VRDisplay.cpp index edaa34fa49b2..3bd87aed1d24 100644 --- a/dom/vr/VRDisplay.cpp +++ b/dom/vr/VRDisplay.cpp @@ -246,7 +246,9 @@ void VRPose::GetPosition(JSContext* aCx, JS::MutableHandle aRetval, SetFloat32Array( aCx, aRetval, mPosition, mVRState.pose.position, 3, !mPosition && - bool(mVRState.flags & gfx::VRDisplayCapabilityFlags::Cap_Position), + (bool(mVRState.flags & gfx::VRDisplayCapabilityFlags::Cap_Position) || + bool(mVRState.flags & + gfx::VRDisplayCapabilityFlags::Cap_PositionEmulated)), aRv); } diff --git a/gfx/vr/external_api/moz_external_vr.h b/gfx/vr/external_api/moz_external_vr.h index e3e688f3cbff..8b8c1ffeadca 100644 --- a/gfx/vr/external_api/moz_external_vr.h +++ b/gfx/vr/external_api/moz_external_vr.h @@ -34,7 +34,7 @@ enum class GamepadCapabilityFlags : uint16_t; #endif // MOZILLA_INTERNAL_API namespace gfx { -static const int32_t kVRExternalVersion = 6; +static const int32_t kVRExternalVersion = 7; // We assign VR presentations to groups with a bitmask. // Currently, we will only display either content or chrome. @@ -159,10 +159,15 @@ enum class VRDisplayCapabilityFlags : uint16_t { * user is wearing the device. */ Cap_MountDetection = 1 << 8, + /** + * Cap_PositionEmulated is set if the VRDisplay is capable of setting a + * emulated position (e.g. neck model) even if still doesn't support 6DOF tracking. + */ + Cap_PositionEmulated = 1 << 9, /** * Cap_All used for validity checking during IPC serialization */ - Cap_All = (1 << 9) - 1 + Cap_All = (1 << 10) - 1 }; #ifdef MOZILLA_INTERNAL_API