aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas_traits/webgl.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2020-03-09 19:58:21 -0400
committerGitHub <noreply@github.com>2020-03-09 19:58:21 -0400
commitb4d7ec1c99259f936c9e34de157b652707d308de (patch)
tree29ce20cb86641f45243bf7cad41e50ca8becea1c /components/canvas_traits/webgl.rs
parent95f3d46644243b24b5c7c25b6b5d1dc50c34f0d3 (diff)
parentfbcf2bbc3ef4ba0c37a6a8d77bfee96b08f3cccc (diff)
downloadservo-b4d7ec1c99259f936c9e34de157b652707d308de.tar.gz
servo-b4d7ec1c99259f936c9e34de157b652707d308de.zip
Auto merge of #25855 - jdm:surface-inversion, r=Manishearth,asajeffrey
Remove GL->d3d blit in HoloLens immersive mode Depends on: * https://github.com/servo/surfman/pull/151 * https://github.com/asajeffrey/surfman-chains/pull/7 * https://github.com/servo/webxr/pull/133 These changes add two extra APIs for embedders to use when registering a WebXR device - one to allow running any closure as a task in the webgl thread, and one to register an arbitrary surface provider for a particular webxr session. When an openxr session is started, it can then obtain the webgl thread's d3d device from that thread's surfman device and ensure that openxr uses it. Surface providers are traits that have their methods invoked by the webgl thread as part of the the normal swapchain operations. This allows the openxr surface provider to return surfaces that wrap the underlying openxr textures, which are valid in the webgl thread and can be used as the target of an opaque framebuffer. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #25735 - [x] These changes do not require tests because there are no windows immersive mode tests
Diffstat (limited to 'components/canvas_traits/webgl.rs')
-rw-r--r--components/canvas_traits/webgl.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/components/canvas_traits/webgl.rs b/components/canvas_traits/webgl.rs
index 56e43b9ab7b..bf85e714905 100644
--- a/components/canvas_traits/webgl.rs
+++ b/components/canvas_traits/webgl.rs
@@ -14,6 +14,7 @@ use std::num::{NonZeroU32, NonZeroU64};
use std::ops::Deref;
use webrender_api::{DocumentId, ImageKey, PipelineId};
use webvr_traits::WebVRPoseInformation;
+use webxr_api::SessionId;
use webxr_api::SwapChainId as WebXRSwapChainId;
/// Helper function that creates a WebGL channel (WebGLSender, WebGLReceiver) to be used in WebGLCommands.
@@ -80,6 +81,7 @@ pub enum WebGLMsg {
WebGLContextId,
Size2D<i32>,
WebGLSender<Option<WebXRSwapChainId>>,
+ SessionId,
),
/// Performs a buffer swap.
///
@@ -188,9 +190,14 @@ impl WebGLMsgSender {
&self,
size: Size2D<i32>,
sender: WebGLSender<Option<WebXRSwapChainId>>,
+ id: SessionId,
) -> WebGLSendResult {
- self.sender
- .send(WebGLMsg::CreateWebXRSwapChain(self.ctx_id, size, sender))
+ self.sender.send(WebGLMsg::CreateWebXRSwapChain(
+ self.ctx_id,
+ size,
+ sender,
+ id,
+ ))
}
#[inline]