mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Pass the GL context to the VRDisplay when rendering
This commit is contained in:
parent
42ebf46172
commit
8ddde7eacc
7 changed files with 34 additions and 22 deletions
|
@ -210,15 +210,19 @@ impl<VR: WebVRRenderHandler + 'static> WebGLThread<VR> {
|
|||
|
||||
/// Handles a WebVRCommand for a specific WebGLContext
|
||||
fn handle_webvr_command(&mut self, context_id: WebGLContextId, command: WebVRCommand) {
|
||||
Self::make_current_if_needed(context_id, &self.contexts, &mut self.bound_context_id);
|
||||
let texture = match command {
|
||||
WebVRCommand::SubmitFrame(..) => self.cached_context_info.get(&context_id),
|
||||
_ => None,
|
||||
};
|
||||
self.webvr_compositor
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.handle(command, texture.map(|t| (t.texture_id, t.size)));
|
||||
if let Some(context) =
|
||||
Self::make_current_if_needed(context_id, &self.contexts, &mut self.bound_context_id)
|
||||
{
|
||||
let texture = match command {
|
||||
WebVRCommand::SubmitFrame(..) => self.cached_context_info.get(&context_id),
|
||||
_ => None,
|
||||
};
|
||||
self.webvr_compositor.as_mut().unwrap().handle(
|
||||
context.ctx.gl(),
|
||||
command,
|
||||
texture.map(|t| (t.texture_id, t.size)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Handles a lock external callback received from webrender::ExternalImageHandler
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue