aboutsummaryrefslogtreecommitdiffstats
path: root/components/constellation
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2019-07-02 12:34:58 -0500
committerAlan Jeffrey <ajeffrey@mozilla.com>2019-07-03 08:53:40 -0500
commit9eb75d4ea6d5df75f8bc18103401e565648c3b9d (patch)
tree4793587ed36f5d05d65d0915d5aef8584631bce4 /components/constellation
parentfee1418b43264771a5de6dfeaa94128fa6bf8793 (diff)
downloadservo-9eb75d4ea6d5df75f8bc18103401e565648c3b9d.tar.gz
servo-9eb75d4ea6d5df75f8bc18103401e565648c3b9d.zip
Use webxr IPC to get a WebXR device registry to each script thread
Diffstat (limited to 'components/constellation')
-rw-r--r--components/constellation/Cargo.toml1
-rw-r--r--components/constellation/constellation.rs8
-rw-r--r--components/constellation/pipeline.rs6
3 files changed, 15 insertions, 0 deletions
diff --git a/components/constellation/Cargo.toml b/components/constellation/Cargo.toml
index 718e537e64b..f91396343d8 100644
--- a/components/constellation/Cargo.toml
+++ b/components/constellation/Cargo.toml
@@ -50,6 +50,7 @@ servo_remutex = {path = "../remutex"}
servo_url = {path = "../url"}
webvr_traits = {path = "../webvr_traits"}
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
+webxr-api = {git = "https://github.com/servo/webxr", features = ["ipc"]}
[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os="android"), not(target_arch="arm"), not(target_arch="aarch64")))'.dependencies]
gaol = {git = "https://github.com/servo/gaol"}
diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs
index 6f8bfbcb849..558734031ec 100644
--- a/components/constellation/constellation.rs
+++ b/components/constellation/constellation.rs
@@ -390,6 +390,9 @@ pub struct Constellation<Message, LTF, STF> {
/// A channel through which messages can be sent to the webvr thread.
webvr_chan: Option<IpcSender<WebVRMsg>>,
+ /// The XR device registry
+ webxr_registry: webxr_api::Registry,
+
/// A channel through which messages can be sent to the canvas paint thread.
canvas_chan: IpcSender<CanvasMsg>,
@@ -455,6 +458,9 @@ pub struct InitialConstellationState {
/// A channel to the webgl thread.
pub webvr_chan: Option<IpcSender<WebVRMsg>>,
+
+ /// The XR device registry
+ pub webxr_registry: webxr_api::Registry,
}
/// Data needed for webdriver
@@ -751,6 +757,7 @@ where
}),
webgl_threads: state.webgl_threads,
webvr_chan: state.webvr_chan,
+ webxr_registry: state.webxr_registry,
canvas_chan: CanvasPaintThread::start(),
pending_approval_navigations: HashMap::new(),
pressed_mouse_buttons: 0,
@@ -997,6 +1004,7 @@ where
.as_ref()
.map(|threads| threads.pipeline()),
webvr_chan: self.webvr_chan.clone(),
+ webxr_registry: self.webxr_registry.clone(),
});
let pipeline = match result {
diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs
index 3c1ebd7896a..9b1f0e7b336 100644
--- a/components/constellation/pipeline.rs
+++ b/components/constellation/pipeline.rs
@@ -188,6 +188,9 @@ pub struct InitialPipelineState {
/// A channel to the webvr thread.
pub webvr_chan: Option<IpcSender<WebVRMsg>>,
+
+ /// The XR device registry
+ pub webxr_registry: webxr_api::Registry,
}
pub struct NewPipeline {
@@ -305,6 +308,7 @@ impl Pipeline {
webrender_document: state.webrender_document,
webgl_chan: state.webgl_chan,
webvr_chan: state.webvr_chan,
+ webxr_registry: state.webxr_registry,
};
// Spawn the child process.
@@ -510,6 +514,7 @@ pub struct UnprivilegedPipelineContent {
webrender_document: webrender_api::DocumentId,
webgl_chan: Option<WebGLPipeline>,
webvr_chan: Option<IpcSender<WebVRMsg>>,
+ webxr_registry: webxr_api::Registry,
}
impl UnprivilegedPipelineContent {
@@ -554,6 +559,7 @@ impl UnprivilegedPipelineContent {
content_process_shutdown_chan: self.script_content_process_shutdown_chan,
webgl_chan: self.webgl_chan,
webvr_chan: self.webvr_chan,
+ webxr_registry: self.webxr_registry,
webrender_document: self.webrender_document,
webrender_api_sender: self.webrender_api_sender.clone(),
layout_is_busy: layout_thread_busy_flag.clone(),