Support for ExternalVR implementation

This commit is contained in:
Paul Rouget 2019-02-05 05:20:26 +01:00
parent b7e9bab267
commit c055b74e13
11 changed files with 66 additions and 13 deletions

View file

@ -21,6 +21,7 @@ use servo::servo_url::ServoUrl;
use servo::{self, gl, webrender_api, BrowserId, Servo};
use std::cell::{Cell, RefCell};
use std::mem;
use std::os::raw::c_void;
use std::path::PathBuf;
use std::rc::Rc;
@ -39,6 +40,7 @@ pub struct InitOptions {
pub width: u32,
pub height: u32,
pub density: f32,
pub vr_pointer: Option<*mut c_void>,
pub enable_subpixel_text_antialiasing: bool,
}
@ -152,6 +154,7 @@ pub fn init(
width: Cell::new(init_opts.width),
height: Cell::new(init_opts.height),
density: init_opts.density,
vr_pointer: init_opts.vr_pointer,
waker,
});
@ -495,6 +498,7 @@ struct ServoCallbacks {
width: Cell<u32>,
height: Cell<u32>,
density: f32,
vr_pointer: Option<*mut c_void>,
}
impl WindowMethods for ServoCallbacks {
@ -536,6 +540,10 @@ impl WindowMethods for ServoCallbacks {
hidpi_factor: TypedScale::new(self.density),
}
}
fn get_vrexternal_pointer(&self) -> Option<*mut c_void> {
self.vr_pointer.clone()
}
}
struct ResourceReader(Box<dyn ReadFileTrait + Send + Sync>);