Auto merge of #22773 - paulrouget:immersive, r=jdm

Support for ExternalVR implementation

This PR adds the hook necessary for the ExternalVR rust-webvr driver.
Waiting on rust-webvr 0.9.3 to be published before landing.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22773)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-02-07 00:17:26 -05:00 committed by GitHub
commit 6c161e5037
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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,
}
@ -146,6 +148,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,
});
@ -489,6 +492,7 @@ struct ServoCallbacks {
width: Cell<u32>,
height: Cell<u32>,
density: f32,
vr_pointer: Option<*mut c_void>,
}
impl WindowMethods for ServoCallbacks {
@ -530,6 +534,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 ResourceReaderInstance;