diff --git a/Cargo.lock b/Cargo.lock index 38517119285..0942a6c41ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2434,7 +2434,7 @@ dependencies = [ "libc 0.2.53 (registry+https://github.com/rust-lang/crates.io-index)", "libservo 0.0.1", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-webvr 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-webvr 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "simpleservo 0.0.1", "smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3626,7 +3626,7 @@ dependencies = [ [[package]] name = "rust-webvr" -version = "0.12.2" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bindgen 0.49.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3639,12 +3639,12 @@ dependencies = [ "libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "ovr-mobile-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-webvr-api 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-webvr-api 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rust-webvr-api" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "android_injected_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3977,7 +3977,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "osmesa-src 0.1.0 (git+https://github.com/servo/osmesa-src)", "osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-webvr 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-webvr 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "sig 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "tinyfiledialogs 3.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5309,8 +5309,8 @@ dependencies = [ "ipc-channel 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", - "rust-webvr 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-webvr-api 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-webvr 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-webvr-api 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "script_traits 0.0.1", "servo_config 0.0.1", "webvr_traits 0.0.1", @@ -5322,7 +5322,7 @@ version = "0.0.1" dependencies = [ "ipc-channel 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", - "rust-webvr-api 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-webvr-api 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -5843,8 +5843,8 @@ dependencies = [ "checksum regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfd8681eebe297b81d98498869d4aae052137651ad7b96822f09ceb690d0a96" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "da06feaa07f69125ab9ddc769b11de29090122170b402547f64b86fe16ebc399" -"checksum rust-webvr 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "db3a145f737e4bf51cd4f7d29262f2b2e46e76b116070cbbfc0959553b2e8006" -"checksum rust-webvr-api 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4f3a81b1acf3c6295f9c180e8ade671858865ee4e11d114ecf60974e86b2e0" +"checksum rust-webvr 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab628b77aaacca496483788a5e0184d42af6dc0e938551aa5be20676c84dd196" +"checksum rust-webvr-api 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63d01034b181187e7d048ef4c5caaf95d28d0f7973834907fe7dd74b2bfb66e8" "checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rusttype 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b8eb11f5b0a98c8eca2fb1483f42646d8c340e83e46ab416f8a063a0fd0eeb20" diff --git a/components/script/dom/fakexrdevice.rs b/components/script/dom/fakexrdevice.rs new file mode 100644 index 00000000000..070ba5fa89c --- /dev/null +++ b/components/script/dom/fakexrdevice.rs @@ -0,0 +1,121 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +use crate::dom::bindings::codegen::Bindings::FakeXRDeviceBinding::{ + self, FakeXRDeviceMethods, FakeXRRigidTransformInit, FakeXRViewInit, +}; +use crate::dom::bindings::codegen::Bindings::XRViewBinding::XREye; +use crate::dom::bindings::error::{Error, Fallible}; +use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; +use crate::dom::bindings::root::DomRoot; +use crate::dom::globalscope::GlobalScope; +use dom_struct::dom_struct; +use webvr_traits::{MockVRControlMsg, MockVRView, WebVRMsg}; + +#[dom_struct] +pub struct FakeXRDevice { + reflector: Reflector, +} + +impl FakeXRDevice { + pub fn new_inherited() -> FakeXRDevice { + FakeXRDevice { + reflector: Reflector::new(), + } + } + + pub fn new(global: &GlobalScope) -> DomRoot { + reflect_dom_object( + Box::new(FakeXRDevice::new_inherited()), + global, + FakeXRDeviceBinding::Wrap, + ) + } + + fn send_msg(&self, msg: MockVRControlMsg) { + self.global() + .as_window() + .webvr_thread() + .unwrap() + .send(WebVRMsg::MessageMockDisplay(msg)) + .unwrap(); + } +} + +pub fn get_views(views: &[FakeXRViewInit]) -> Fallible<(MockVRView, MockVRView)> { + if views.len() != 2 { + return Err(Error::NotSupported); + } + + let (left, right) = match (views[0].eye, views[1].eye) { + (XREye::Left, XREye::Right) => (&views[0], &views[1]), + (XREye::Right, XREye::Left) => (&views[1], &views[0]), + _ => return Err(Error::NotSupported), + }; + + if left.projectionMatrix.len() != 16 || + right.projectionMatrix.len() != 16 || + left.viewOffset.position.len() != 3 || + right.viewOffset.position.len() != 3 + { + return Err(Error::Type("Incorrectly sized array".into())); + } + + let mut proj_l = [0.; 16]; + let mut proj_r = [0.; 16]; + let v: Vec<_> = left.projectionMatrix.iter().map(|x| **x).collect(); + proj_l.copy_from_slice(&v); + let v: Vec<_> = right.projectionMatrix.iter().map(|x| **x).collect(); + proj_r.copy_from_slice(&v); + + let mut offset_l = [0.; 3]; + let mut offset_r = [0.; 3]; + let v: Vec<_> = left.viewOffset.position.iter().map(|x| **x).collect(); + offset_l.copy_from_slice(&v); + let v: Vec<_> = right.viewOffset.position.iter().map(|x| **x).collect(); + offset_r.copy_from_slice(&v); + let left = MockVRView { + projection: proj_l, + offset: offset_l, + }; + let right = MockVRView { + projection: proj_r, + offset: offset_r, + }; + Ok((left, right)) +} + +pub fn get_origin(origin: &FakeXRRigidTransformInit) -> Fallible<([f32; 3], [f32; 4])> { + if origin.position.len() != 3 || origin.orientation.len() != 4 { + return Err(Error::Type("Incorrectly sized array".into())); + } + let mut p = [0.; 3]; + let mut o = [0.; 4]; + let v: Vec<_> = origin.position.iter().map(|x| **x).collect(); + p.copy_from_slice(&v[0..3]); + let v: Vec<_> = origin.orientation.iter().map(|x| **x).collect(); + o.copy_from_slice(&v); + + Ok((p, o)) +} + +impl FakeXRDeviceMethods for FakeXRDevice { + /// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md + fn SetViews(&self, views: Vec) -> Fallible<()> { + let (left, right) = get_views(&views)?; + self.send_msg(MockVRControlMsg::SetViews(left, right)); + Ok(()) + } + + /// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md + fn SetViewerOrigin( + &self, + origin: &FakeXRRigidTransformInit, + _emulated_position: bool, + ) -> Fallible<()> { + let (position, orientation) = get_origin(origin)?; + self.send_msg(MockVRControlMsg::SetViewerPose(position, orientation)); + Ok(()) + } +} diff --git a/components/script/dom/fakexrdevicecontroller.rs b/components/script/dom/fakexrdevicecontroller.rs deleted file mode 100644 index a7ed2833716..00000000000 --- a/components/script/dom/fakexrdevicecontroller.rs +++ /dev/null @@ -1,104 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -use crate::dom::bindings::codegen::Bindings::FakeXRDeviceControllerBinding::{ - self, FakeXRDeviceControllerMethods, FakeXRRigidTransform, FakeXRViewInit, -}; -use crate::dom::bindings::codegen::Bindings::XRViewBinding::XREye; -use crate::dom::bindings::error::{Error, Fallible}; -use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; -use crate::dom::bindings::root::DomRoot; -use crate::dom::globalscope::GlobalScope; -use dom_struct::dom_struct; -use webvr_traits::{MockVRControlMsg, WebVREyeParameters, WebVRMsg}; - -#[dom_struct] -pub struct FakeXRDeviceController { - reflector: Reflector, -} - -impl FakeXRDeviceController { - pub fn new_inherited() -> FakeXRDeviceController { - FakeXRDeviceController { - reflector: Reflector::new(), - } - } - - pub fn new(global: &GlobalScope) -> DomRoot { - reflect_dom_object( - Box::new(FakeXRDeviceController::new_inherited()), - global, - FakeXRDeviceControllerBinding::Wrap, - ) - } - - pub fn send_msg(&self, msg: MockVRControlMsg) { - self.global() - .as_window() - .webvr_thread() - .unwrap() - .send(WebVRMsg::MessageMockDisplay(msg)) - .unwrap(); - } -} - -impl FakeXRDeviceControllerMethods for FakeXRDeviceController { - /// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md - fn SetViews(&self, views: Vec) -> Fallible<()> { - if views.len() != 2 { - return Err(Error::NotSupported); - } - - let (left, right) = match (views[0].eye, views[1].eye) { - (XREye::Left, XREye::Right) => (&views[0], &views[1]), - (XREye::Right, XREye::Left) => (&views[1], &views[0]), - _ => return Err(Error::NotSupported), - }; - - if left.projectionMatrix.len() != 16 || - right.projectionMatrix.len() != 16 || - left.viewOffset.position.len() != 3 || - right.viewOffset.position.len() != 3 - { - return Err(Error::Type("Incorrectly sized array".into())); - } - - let mut proj_l = [0.; 16]; - let mut proj_r = [0.; 16]; - let v: Vec<_> = left.projectionMatrix.iter().map(|x| **x).collect(); - proj_l.copy_from_slice(&v); - let v: Vec<_> = right.projectionMatrix.iter().map(|x| **x).collect(); - proj_r.copy_from_slice(&v); - - let mut params_l = WebVREyeParameters::default(); - let mut params_r = WebVREyeParameters::default(); - let v: Vec<_> = left.viewOffset.position.iter().map(|x| **x).collect(); - params_l.offset.copy_from_slice(&v); - let v: Vec<_> = right.viewOffset.position.iter().map(|x| **x).collect(); - params_r.offset.copy_from_slice(&v); - - self.send_msg(MockVRControlMsg::SetProjectionMatrices(proj_l, proj_r)); - self.send_msg(MockVRControlMsg::SetEyeParameters(params_l, params_r)); - Ok(()) - } - - /// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md - fn SetViewerOrigin(&self, origin: &FakeXRRigidTransform) -> Fallible<()> { - if origin.position.len() != 4 || origin.orientation.len() != 4 { - return Err(Error::Type("Incorrectly sized array".into())); - } - let mut position = [0.; 3]; - let mut orientation = [0.; 4]; - let v: Vec<_> = origin.position.iter().map(|x| **x).collect(); - position.copy_from_slice(&v[0..3]); - let v: Vec<_> = origin.orientation.iter().map(|x| **x).collect(); - orientation.copy_from_slice(&v); - self.send_msg(MockVRControlMsg::SetViewerPose(position, orientation)); - Ok(()) - } -} diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index 77729567558..d20b68c92b7 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -301,7 +301,7 @@ pub mod eventsource; pub mod eventtarget; pub mod extendableevent; pub mod extendablemessageevent; -pub mod fakexrdevicecontroller; +pub mod fakexrdevice; pub mod file; pub mod filelist; pub mod filereader; diff --git a/components/script/dom/webidls/FakeXRDevice.webidl b/components/script/dom/webidls/FakeXRDevice.webidl new file mode 100644 index 00000000000..5e310c4d75f --- /dev/null +++ b/components/script/dom/webidls/FakeXRDevice.webidl @@ -0,0 +1,57 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +// https://github.com/immersive-web/webxr-test-api/ + +[Exposed=Window, Pref="dom.webxr.test"] +interface FakeXRDevice { + // Sets the values to be used for subsequent + // requestAnimationFrame() callbacks. + [Throws] void setViews(sequence views); + + // // behaves as if device was disconnected + // Promise disconnect(); + + // Sets the origin of the viewer + [Throws] void setViewerOrigin(FakeXRRigidTransformInit origin, optional boolean emulatedPosition = false); + + // // Simulates devices focusing and blurring sessions. + // void simulateVisibilityChange(XRVisibilityState); + + // void setBoundsGeometry(sequence boundsCoodinates); + // // Sets eye level used for calculating floor-level spaces + // void setEyeLevel(float eyeLevel); + + + // Promise + // simulateInputSourceConnection(FakeXRInputSourceInit); +}; + +// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-getviewport +dictionary FakeXRViewInit { + required XREye eye; + // https://immersive-web.github.io/webxr/#view-projection-matrix + required sequence projectionMatrix; + // https://immersive-web.github.io/webxr/#view-offset + required FakeXRRigidTransformInit viewOffset; + // https://immersive-web.github.io/webxr/#dom-xrwebgllayer-getviewport + required FakeXRViewportInit viewport; +}; + +// https://immersive-web.github.io/webxr/#xrviewport +dictionary FakeXRViewportInit { + required long x; + required long y; + required long width; + required long height; +}; + +dictionary FakeXRBoundsPoint { + double x; double z; +}; + +dictionary FakeXRRigidTransformInit { + required sequence position; + required sequence orientation; +}; diff --git a/components/script/dom/webidls/FakeXRDeviceController.webidl b/components/script/dom/webidls/FakeXRDeviceController.webidl deleted file mode 100644 index cacdb2f9819..00000000000 --- a/components/script/dom/webidls/FakeXRDeviceController.webidl +++ /dev/null @@ -1,49 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -// https://github.com/immersive-web/webxr-test-api/ - -[Exposed=Window, Pref="dom.webxr.test"] -interface FakeXRDeviceController { - // Creates and attaches a XRFrameOfReference of the type specified to the device. - // void setFrameOfReference(XRFrameOfReferenceType, FakeXRFrameOfReferenceInit); - - // // Sets the values to be used for subsequent - // // requestAnimationFrame() callbacks. - [Throws] void setViews(sequence views); - - [Throws] void setViewerOrigin(FakeXRRigidTransform origin); - - // Simulates the user activating the reset pose on a device. - // void simulateResetPose(); - - // Simulates the platform ending the sessions. - // void simulateForcedEndSessions(); - - // Simulates devices focusing and blurring sessions. - // void simulateBlurSession(XRSession); - // void simulateFocusSession(XRSession); - - // void setBoundsGeometry(Array boundsCoodinates)l - - // Promise - // simulateInputSourceConnection(FakeXRInputSourceInit); -}; - -dictionary FakeXRViewInit { - required XREye eye; - // https://immersive-web.github.io/webxr/#view-projection-matrix - required sequence projectionMatrix; - // https://immersive-web.github.io/webxr/#view-offset - required FakeXRRigidTransform viewOffset; -}; - -dictionary FakeXRBoundsPoint { - double x; double z; -}; - -dictionary FakeXRRigidTransform { - required sequence position; - required sequence orientation; -}; diff --git a/components/script/dom/webidls/XRTest.webidl b/components/script/dom/webidls/XRTest.webidl index 30c485321d4..f74b9b82331 100644 --- a/components/script/dom/webidls/XRTest.webidl +++ b/components/script/dom/webidls/XRTest.webidl @@ -8,18 +8,28 @@ interface XRTest { // Simulates connecting a device to the system. // Used to instantiate a fake device for use in tests. - Promise simulateDeviceConnection(FakeXRDeviceInit init); - - // // Simulates a device being disconnected from the system. - // Promise simulateDeviceDisconnection(XRDevice); + Promise simulateDeviceConnection(FakeXRDeviceInit init); // // Simulates a user activation (aka user gesture) for the current scope. // // The activation is only guaranteed to be valid in the provided function and only applies to WebXR // // Device API methods. // void simulateUserActivation(Function); + + // // Disconnect all fake devices + // Promise disconnectAllDevices(); }; dictionary FakeXRDeviceInit { - // TODO: Subject to change to match spec changes. required boolean supportsImmersive; + required sequence views; + + boolean supportsUnbounded = false; + // Whether the space supports tracking in inline sessions + boolean supportsTrackingInInline = true; + // The bounds coordinates. If null, bounded reference spaces are not supported. + sequence boundsCoodinates; + // Eye level used for calculating floor-level spaces + float eyeLevel = 1.5; + FakeXRRigidTransformInit viewerOrigin; }; + diff --git a/components/script/dom/xrtest.rs b/components/script/dom/xrtest.rs index 07fac9d6a89..6808ce262cd 100644 --- a/components/script/dom/xrtest.rs +++ b/components/script/dom/xrtest.rs @@ -11,13 +11,13 @@ use crate::dom::bindings::codegen::Bindings::XRTestBinding::{ }; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; -use crate::dom::fakexrdevicecontroller::FakeXRDeviceController; +use crate::dom::fakexrdevice::{get_origin, get_views, FakeXRDevice}; use crate::dom::globalscope::GlobalScope; use crate::dom::promise::Promise; use dom_struct::dom_struct; use std::cell::Cell; use std::rc::Rc; -use webvr_traits::WebVRMsg; +use webvr_traits::{MockVRInit, WebVRMsg}; #[dom_struct] pub struct XRTest { @@ -52,14 +52,40 @@ impl XRTestMethods for XRTest { return p; } + let origin = if let Some(ref o) = init.viewerOrigin { + match get_origin(&o) { + Ok(origin) => origin, + Err(e) => { + p.reject_error(e); + return p; + }, + } + } else { + Default::default() + }; + + let views = match get_views(&init.views) { + Ok(views) => views, + Err(e) => { + p.reject_error(e); + return p; + }, + }; + + let init = MockVRInit { + viewer_origin: Some(origin), + views: Some(views), + eye_level: None, + }; + self.session_started.set(true); self.global() .as_window() .webvr_thread() .unwrap() - .send(WebVRMsg::CreateMockDisplay) + .send(WebVRMsg::CreateMockDisplay(init)) .unwrap(); - p.resolve_native(&FakeXRDeviceController::new(&self.global())); + p.resolve_native(&FakeXRDevice::new(&self.global())); p } diff --git a/components/webvr/Cargo.toml b/components/webvr/Cargo.toml index ff627cd0fe5..02da9dbd6f3 100644 --- a/components/webvr/Cargo.toml +++ b/components/webvr/Cargo.toml @@ -22,8 +22,8 @@ gleam = "0.6" ipc-channel = "0.11.2" log = "0.4" msg = {path = "../msg"} -rust-webvr = {version = "0.12", features = ["mock", "openvr", "vrexternal"]} -rust-webvr-api = "0.12" +rust-webvr = {version = "0.13", features = ["mock", "openvr", "vrexternal"]} +rust-webvr-api = "0.13" script_traits = {path = "../script_traits"} servo_config = {path = "../config"} webvr_traits = {path = "../webvr_traits" } diff --git a/components/webvr/webvr_thread.rs b/components/webvr/webvr_thread.rs index 2cd4c81ab35..0da3b98d820 100644 --- a/components/webvr/webvr_thread.rs +++ b/components/webvr/webvr_thread.rs @@ -135,8 +135,8 @@ impl WebVRThread { self.handle_get_gamepads_for_display(display_id, sender); }, - WebVRMsg::CreateMockDisplay => { - self.handle_create_mock(); + WebVRMsg::CreateMockDisplay(init) => { + self.handle_create_mock(init); }, WebVRMsg::MessageMockDisplay(msg) => { self.handle_message_mock_display(msg); @@ -312,12 +312,12 @@ impl WebVRThread { sender.send(Ok(data)).unwrap(); } - fn handle_create_mock(&mut self) { + fn handle_create_mock(&mut self, init: MockVRInit) { if self.mock.is_some() { warn!("Mock display already created"); return; } - self.mock = Some(self.service.register_mock_with_remote()); + self.mock = Some(self.service.register_mock_with_remote(init)); } fn handle_message_mock_display(&mut self, msg: MockVRControlMsg) { diff --git a/components/webvr_traits/Cargo.toml b/components/webvr_traits/Cargo.toml index dfd78a52bc7..c3a78fea23a 100644 --- a/components/webvr_traits/Cargo.toml +++ b/components/webvr_traits/Cargo.toml @@ -13,5 +13,5 @@ path = "lib.rs" [dependencies] ipc-channel = "0.11" msg = {path = "../msg"} -rust-webvr-api = {version = "0.12", features = ["ipc"]} +rust-webvr-api = {version = "0.13", features = ["ipc"]} serde = "1.0" diff --git a/components/webvr_traits/lib.rs b/components/webvr_traits/lib.rs index d5d99f98a3b..a00af7b5df6 100644 --- a/components/webvr_traits/lib.rs +++ b/components/webvr_traits/lib.rs @@ -11,7 +11,6 @@ mod webvr_traits; pub use crate::webvr_traits::{WebVRMsg, WebVRResult}; pub use rust_webvr_api as webvr; -pub use rust_webvr_api::MockVRControlMsg; pub use rust_webvr_api::VRDisplayCapabilities as WebVRDisplayCapabilities; pub use rust_webvr_api::VRDisplayData as WebVRDisplayData; pub use rust_webvr_api::VRDisplayEvent as WebVRDisplayEvent; @@ -31,6 +30,7 @@ pub use rust_webvr_api::VRLayer as WebVRLayer; pub use rust_webvr_api::VRMainThreadHeartbeat as WebVRMainThreadHeartbeat; pub use rust_webvr_api::VRPose as WebVRPose; pub use rust_webvr_api::VRStageParameters as WebVRStageParameters; +pub use rust_webvr_api::{MockVRControlMsg, MockVRInit, MockVRView}; #[derive(Deserialize, Serialize)] pub struct WebVRPoseInformation { diff --git a/components/webvr_traits/webvr_traits.rs b/components/webvr_traits/webvr_traits.rs index 3123c8b5faf..573aca76ab2 100644 --- a/components/webvr_traits/webvr_traits.rs +++ b/components/webvr_traits/webvr_traits.rs @@ -26,7 +26,7 @@ pub enum WebVRMsg { RequestPresent(PipelineId, u32, IpcSender>), ExitPresent(PipelineId, u32, Option>>), CreateCompositor(u32), - CreateMockDisplay, + CreateMockDisplay(MockVRInit), MessageMockDisplay(MockVRControlMsg), GetGamepads( Vec, diff --git a/ports/glutin/Cargo.toml b/ports/glutin/Cargo.toml index 11d86190800..6bf0efa5fd8 100644 --- a/ports/glutin/Cargo.toml +++ b/ports/glutin/Cargo.toml @@ -54,7 +54,7 @@ lazy_static = "1" libservo = {path = "../../components/servo"} libc = "0.2" log = "0.4" -rust-webvr = { version = "0.12", features = ["glwindow"] } +rust-webvr = { version = "0.13", features = ["glwindow"] } tinyfiledialogs = "3.0" [target.'cfg(any(target_os = "linux", target_os = "windows"))'.dependencies] diff --git a/ports/libmlservo/Cargo.toml b/ports/libmlservo/Cargo.toml index d641106b07c..ac04dc44c0f 100644 --- a/ports/libmlservo/Cargo.toml +++ b/ports/libmlservo/Cargo.toml @@ -19,7 +19,7 @@ raqote_backend = ["simpleservo/raqote_backend"] [dependencies] libservo = { path = "../../components/servo", features = ["no_static_freetype"] } simpleservo = { path = "../libsimpleservo/api", features = ["no_static_freetype"] } -rust-webvr = { version = "0.12", features = ["magicleap"] } +rust-webvr = { version = "0.13", features = ["magicleap"] } libc = "0.2" log = "0.4" servo-egl = "0.2" diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index c32bb3cf8d4..9d98e1d36c5 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -19683,15 +19683,15 @@ "testharness" ], "webxr/create_session.html": [ - "306ab85d3b1b914d2dd7c11a3b03dccd990148ae", + "ddec5add27b84e8e2febe3789d326f1e9fb7f508", "testharness" ], "webxr/obtain_frame.html": [ - "99d8fd1ef152e4030444c3ca42482d28c3e855d3", + "e2b4424d5779baedf6bdb50f1b3151336f31a4cb", "testharness" ], "webxr/resources/webxr-util.js": [ - "b644ba72ac801bc8f659e9678d31ab23db0b7281", + "554c1c183d3710e54dc60704dad0aac542ffd67c", "support" ] }, diff --git a/tests/wpt/mozilla/tests/webxr/create_session.html b/tests/wpt/mozilla/tests/webxr/create_session.html index 306ab85d3b1..ddec5add27b 100644 --- a/tests/wpt/mozilla/tests/webxr/create_session.html +++ b/tests/wpt/mozilla/tests/webxr/create_session.html @@ -2,11 +2,16 @@ +