From 9e5ebd408bdb8e2b20a66090e5a79ba8c698112d Mon Sep 17 00:00:00 2001 From: Imanol Fernandez Date: Tue, 3 Dec 2019 20:16:46 +0100 Subject: [PATCH] Bump GV to gv_72.0.20191202091209 (#2405) --- app/src/main/cpp/moz_external_vr.h | 74 ++++++++++++++++++++++++++++-- versions.gradle | 2 +- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/app/src/main/cpp/moz_external_vr.h b/app/src/main/cpp/moz_external_vr.h index 3f78c6cc8..31f2a82e4 100644 --- a/app/src/main/cpp/moz_external_vr.h +++ b/app/src/main/cpp/moz_external_vr.h @@ -47,8 +47,8 @@ namespace gfx { // and mapped files if we have both release and nightlies // running at the same time? Or...what if we have multiple // release builds running on same machine? (Bug 1563232) -#define SHMEM_VERSION "0.0.4" -static const int32_t kVRExternalVersion = 11; +#define SHMEM_VERSION "0.0.5" +static const int32_t kVRExternalVersion = 12; // We assign VR presentations to groups with a bitmask. // Currently, we will only display either content or chrome. @@ -63,6 +63,7 @@ static const uint32_t kVRGroupAll = 0xffffffff; static const int kVRDisplayNameMaxLen = 256; static const int kVRControllerNameMaxLen = 256; +static const int kProfileNameListMaxLen = 256; static const int kVRControllerMaxCount = 16; static const int kVRControllerMaxButtons = 64; static const int kVRControllerMaxAxis = 16; @@ -118,14 +119,22 @@ enum class ControllerCapabilityFlags : uint16_t { * linear acceleration. */ Cap_LinearAcceleration = 1 << 4, + /** + * Cap_GripSpacePosition is set if the Gamepad has a grip space position. + */ + Cap_GripSpacePosition = 1 << 5, /** * Cap_All used for validity checking during IPC serialization */ - Cap_All = (1 << 5) - 1 + Cap_All = (1 << 6) - 1 }; #endif // ifndef MOZILLA_INTERNAL_API +enum class TargetRayMode : uint8_t { Gaze, TrackedPointer, Screen }; + +enum class GamepadMappingType : uint8_t { _empty, Standard, XRStandard }; + enum class VRDisplayBlendMode : uint8_t { Opaque, Additive, AlphaBlend }; enum class VRDisplayCapabilityFlags : uint16_t { @@ -332,6 +341,37 @@ struct VRControllerState { #else ControllerHand hand; #endif + // https://immersive-web.github.io/webxr/#enumdef-xrtargetraymode + TargetRayMode targetRayMode; + + // Space-delimited list of input profile names, in decending order + // of specificity. + // https://immersive-web.github.io/webxr/#dom-xrinputsource-profiles + char profiles[kProfileNameListMaxLen]; + + // https://immersive-web.github.io/webxr-gamepads-module/#enumdef-gamepadmappingtype + GamepadMappingType mappingType; + + // Start frame ID of the most recent primary select + // action, or 0 if the select action has never occurred. + uint64_t selectActionStartFrameId; + // End frame Id of the most recent primary select + // action, or 0 if action never occurred. + // If selectActionStopFrameId is less than + // selectActionStartFrameId, then the select + // action has not ended yet. + uint64_t selectActionStopFrameId; + + // start frame Id of the most recent primary squeeze + // action, or 0 if the squeeze action has never occurred. + uint64_t squeezeActionStartFrameId; + // End frame Id of the most recent primary squeez + // action, or 0 if action never occurred. + // If squeezeActionStopFrameId is less than + // squeezetActionStartFrameId, then the squeeze + // action has not ended yet. + uint64_t squeezeActionEndFrameId; + uint32_t numButtons; uint32_t numAxes; uint32_t numHaptics; @@ -347,9 +387,20 @@ struct VRControllerState { #else ControllerCapabilityFlags flags; #endif + + // When Cap_Position is set in flags, pose corresponds + // to the controllers' pose in target ray space: + // https://immersive-web.github.io/webxr/#dom-xrinputsource-targetrayspace VRPose pose; + + // When Cap_GripSpacePosition is set in flags, gripPose corresponds + // to the controllers' pose in grip space: + // https://immersive-web.github.io/webxr/#dom-xrinputsource-gripspace + VRPose gripPose; + bool isPositionValid; bool isOrientationValid; + #ifdef MOZILLA_INTERNAL_API void Clear() { memset(this, 0, sizeof(VRControllerState)); } #endif @@ -421,6 +472,23 @@ struct VRBrowserState { #if defined(__ANDROID__) bool shutdown; #endif // defined(__ANDROID__) + /** + * In order to support WebXR's navigator.xr.IsSessionSupported call without + * displaying any permission dialogue, it is necessary to have a safe way to + * detect the capability of running a VR or AR session without activating XR + * runtimes or powering on hardware. + * + * API's such as OpenVR make no guarantee that hardware and software won't be + * left activated after enumerating devices, so each backend in gfx/vr/service + * must allow for more granular detection of capabilities. + * + * When detectRuntimesOnly is true, the initialization exits early after + * reporting the presence of XR runtime software. + * + * The result of the runtime detection is reported with the Cap_ImmersiveVR + * and Cap_ImmersiveAR bits in VRDisplayState.flags. + */ + bool detectRuntimesOnly; bool presentationActive; bool navigationTransitionActive; VRLayerState layerState[kVRLayerMaxCount]; diff --git a/versions.gradle b/versions.gradle index 468a88b25..ba09fcd47 100644 --- a/versions.gradle +++ b/versions.gradle @@ -24,7 +24,7 @@ ext.deps = [:] def versions = [:] // GeckoView versions can be found here: // https://maven.mozilla.org/?prefix=maven2/org/mozilla/geckoview/ -versions.gecko_view = "72.0.20191126093448" +versions.gecko_view = "72.0.20191202091209" versions.android_components = "21.0.0" // Note that android-components also depends on application-services, // and in fact is our main source of appservices-related functionality.