aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas_traits/webgl.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-02-27 02:20:30 -0500
committerGitHub <noreply@github.com>2019-02-27 02:20:30 -0500
commitec7a5f21c85d539cc8de58ea702ce5f8ffda0949 (patch)
tree4c14278f1b5ffecbf2d5fc70c33a236f3af8784f /components/canvas_traits/webgl.rs
parentbe3ecc5dc1105c4c02fb5d8f9b33426871c10d06 (diff)
parentc9087013b1bce87302ff49de9c2753262008c59b (diff)
downloadservo-ec7a5f21c85d539cc8de58ea702ce5f8ffda0949.tar.gz
servo-ec7a5f21c85d539cc8de58ea702ce5f8ffda0949.zip
Auto merge of #22938 - asajeffrey:webvr-future-frame-data, r=paulrouget
Use webvr future_frame_data to avoid blocking the WebGL thread <!-- Please describe your changes on the following line: --> This PR fixes a potential deadlock caused by the WebGL thread being blocked on a VR device. Rather than blocking on the VR device, it forwards a future to the script thread, and then then script thread blocks. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes do not require tests because it's fixing a potential deadlock <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/22938) <!-- Reviewable:end -->
Diffstat (limited to 'components/canvas_traits/webgl.rs')
-rw-r--r--components/canvas_traits/webgl.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/components/canvas_traits/webgl.rs b/components/canvas_traits/webgl.rs
index 6b34965ae61..cfa885daa0b 100644
--- a/components/canvas_traits/webgl.rs
+++ b/components/canvas_traits/webgl.rs
@@ -7,12 +7,12 @@ use gleam::gl;
use ipc_channel::ipc::{IpcBytesReceiver, IpcBytesSender, IpcSharedMemory};
use offscreen_gl_context::{GLContextAttributes, GLLimits};
use pixels::PixelFormat;
-use serde_bytes::ByteBuf;
use std::borrow::Cow;
use std::fmt;
use std::num::NonZeroU32;
use std::ops::Deref;
use webrender_api::{DocumentId, ImageKey, PipelineId};
+use webvr_traits::WebVRFutureFrameData;
/// Helper function that creates a WebGL channel (WebGLSender, WebGLReceiver) to be used in WebGLCommands.
pub use crate::webgl_channel::webgl_channel;
@@ -506,7 +506,12 @@ pub enum WebVRCommand {
/// Start presenting to a VR device.
Create(WebVRDeviceId),
/// Synchronize the pose information to be used in the frame.
- SyncPoses(WebVRDeviceId, f64, f64, WebGLSender<Result<ByteBuf, ()>>),
+ SyncPoses(
+ WebVRDeviceId,
+ f64,
+ f64,
+ WebGLSender<Result<WebVRFutureFrameData, ()>>,
+ ),
/// Submit the frame to a VR device using the specified texture coordinates.
SubmitFrame(WebVRDeviceId, [f32; 4], [f32; 4]),
/// Stop presenting to a VR device