diff options
Diffstat (limited to 'components/webvr/webvr_thread.rs')
-rw-r--r-- | components/webvr/webvr_thread.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/components/webvr/webvr_thread.rs b/components/webvr/webvr_thread.rs index 5c6889066b1..1f897689b87 100644 --- a/components/webvr/webvr_thread.rs +++ b/components/webvr/webvr_thread.rs @@ -2,6 +2,7 @@ * 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::VRExternalShmemPtr; use canvas_traits::webgl; use crossbeam_channel::{unbounded, Receiver, Sender}; use euclid::Size2D; @@ -52,9 +53,13 @@ impl WebVRThread { sender: IpcSender<WebVRMsg>, constellation_chan: Sender<ConstellationMsg>, vr_compositor_chan: WebVRCompositorSender, + webvr_shmem: Option<VRExternalShmemPtr>, ) -> WebVRThread { let mut service = VRServiceManager::new(); service.register_defaults(); + if let Some(ptr) = webvr_shmem { + service.register_vrexternal(ptr); + } WebVRThread { receiver: receiver, sender: sender, @@ -69,6 +74,7 @@ impl WebVRThread { pub fn spawn( vr_compositor_chan: WebVRCompositorSender, + webvr_shmem: Option<VRExternalShmemPtr>, ) -> (IpcSender<WebVRMsg>, Sender<Sender<ConstellationMsg>>) { let (sender, receiver) = ipc::channel().unwrap(); let (constellation_sender, constellation_receiver) = unbounded(); @@ -82,6 +88,7 @@ impl WebVRThread { sender_clone, constellation_chan, vr_compositor_chan, + webvr_shmem, ) .start(); }) @@ -157,7 +164,7 @@ impl WebVRThread { ) { match self.access_check(pipeline, display_id) { Ok(display) => sender - .send(Ok(display.borrow().inmediate_frame_data(near, far))) + .send(Ok(display.borrow().immediate_frame_data(near, far))) .unwrap(), Err(msg) => sender.send(Err(msg.into())).unwrap(), } |