Allow the embedder to register their own VRServices

This commit is contained in:
Alan Jeffrey 2019-02-13 17:16:02 -06:00
parent c80c3f3167
commit a062c40567
9 changed files with 48 additions and 45 deletions

View file

@ -18,6 +18,7 @@ use servo::script_traits::{MouseButton, TouchEventType, TouchId};
use servo::servo_config::opts;
use servo::servo_config::prefs::{PrefValue, PREFS};
use servo::servo_url::ServoUrl;
use servo::webvr::{VRExternalShmemPtr, VRServiceManager};
use servo::{self, gl, webrender_api, BrowserId, Servo};
use std::cell::{Cell, RefCell};
use std::mem;
@ -535,8 +536,10 @@ impl WindowMethods for ServoCallbacks {
}
}
fn get_vrexternal_pointer(&self) -> Option<*mut c_void> {
self.vr_pointer.clone()
fn register_vr_services(&self, services: &mut VRServiceManager) {
if let Some(ptr) = self.vr_pointer {
services.register_vrexternal(VRExternalShmemPtr::new(ptr));
}
}
}