mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use webvr future_frame_data to avoid blocking the WebGL thread
This commit is contained in:
parent
a28e15e4ea
commit
c9087013b1
7 changed files with 23 additions and 17 deletions
|
@ -382,11 +382,8 @@ impl webgl::WebVRRenderHandler for WebVRCompositorHandler {
|
|||
},
|
||||
webgl::WebVRCommand::SyncPoses(compositor_id, near, far, sender) => {
|
||||
if let Some(compositor) = self.compositors.get(&compositor_id) {
|
||||
let pose = unsafe {
|
||||
(*compositor.0).sync_poses();
|
||||
(*compositor.0).synced_frame_data(near, far).to_bytes()
|
||||
};
|
||||
let _ = sender.send(Ok(pose.into()));
|
||||
let pose = unsafe { (*compositor.0).future_frame_data(near, far) };
|
||||
let _ = sender.send(Ok(pose));
|
||||
} else {
|
||||
let _ = sender.send(Err(()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue