aboutsummaryrefslogtreecommitdiffstats
path: root/ports/libsimpleservo/api/src/lib.rs
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2019-07-31 17:06:00 -0500
committerAlan Jeffrey <ajeffrey@mozilla.com>2019-08-02 12:14:11 -0500
commit1ca495b32153a2ec7abc4627a14ea03f7f769d85 (patch)
tree7e7aaa1d26dc52cd729f9fb1f3b924acf71c568d /ports/libsimpleservo/api/src/lib.rs
parent196c511d5ebf81b3fe202c5e0c5c1972a6408ab7 (diff)
downloadservo-1ca495b32153a2ec7abc4627a14ea03f7f769d85.tar.gz
servo-1ca495b32153a2ec7abc4627a14ea03f7f769d85.zip
Added magicleap webxr back end
Diffstat (limited to 'ports/libsimpleservo/api/src/lib.rs')
-rw-r--r--ports/libsimpleservo/api/src/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/ports/libsimpleservo/api/src/lib.rs b/ports/libsimpleservo/api/src/lib.rs
index 02c80a2f402..b928a07010f 100644
--- a/ports/libsimpleservo/api/src/lib.rs
+++ b/ports/libsimpleservo/api/src/lib.rs
@@ -48,6 +48,7 @@ pub struct InitOptions {
pub coordinates: Coordinates,
pub density: f32,
pub vr_init: VRInitOptions,
+ pub xr_discovery: Option<Box<dyn webxr_api::Discovery>>,
pub enable_subpixel_text_antialiasing: bool,
pub gl_context_pointer: Option<*const c_void>,
pub native_display_pointer: Option<*const c_void>,
@@ -198,6 +199,7 @@ pub fn init(
let embedder_callbacks = Box::new(ServoEmbedderCallbacks {
vr_init: init_opts.vr_init,
+ xr_discovery: init_opts.xr_discovery,
waker,
});
@@ -576,6 +578,7 @@ impl ServoGlue {
struct ServoEmbedderCallbacks {
waker: Box<dyn EventLoopWaker>,
+ xr_discovery: Option<Box<dyn webxr_api::Discovery>>,
vr_init: VRInitOptions,
}
@@ -607,6 +610,13 @@ impl EmbedderMethods for ServoEmbedderCallbacks {
}
}
+ fn register_webxr(&mut self, registry: &mut webxr_api::MainThreadRegistry) {
+ debug!("EmbedderMethods::register_xr");
+ if let Some(discovery) = self.xr_discovery.take() {
+ registry.register(discovery);
+ }
+ }
+
fn create_event_loop_waker(&mut self) -> Box<dyn EventLoopWaker> {
debug!("EmbedderMethods::create_event_loop_waker");
self.waker.clone()