Auto merge of #26458 - Manishearth:secondary-view, r=asajeffrey

Update webxr with secondary view support

Blocked on https://github.com/servo/webxr/pull/171 , untested
This commit is contained in:
bors-servo 2020-05-12 21:39:50 -04:00 committed by GitHub
commit bdfa6b0751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

8
Cargo.lock generated
View file

@ -3841,7 +3841,7 @@ dependencies = [
[[package]]
name = "openxr"
version = "0.12.1"
source = "git+https://github.com/servo/openxrs.git?branch=xr-msft#676c1f267a607bd8d2a3b984c49625b825c873d0"
source = "git+https://github.com/servo/openxrs.git?branch=xr-msft#fd761bf95d62c26709f8589bd82b495cd8276c8f"
dependencies = [
"libc",
"libloading 0.6.1",
@ -3852,7 +3852,7 @@ dependencies = [
[[package]]
name = "openxr-sys"
version = "0.8.1"
source = "git+https://github.com/servo/openxrs.git?branch=xr-msft#676c1f267a607bd8d2a3b984c49625b825c873d0"
source = "git+https://github.com/servo/openxrs.git?branch=xr-msft#fd761bf95d62c26709f8589bd82b495cd8276c8f"
dependencies = [
"libc",
"winapi",
@ -6471,7 +6471,7 @@ dependencies = [
[[package]]
name = "webxr"
version = "0.0.1"
source = "git+https://github.com/servo/webxr#e30ebd848c4deb95833c2fea91d7d8d34f6d8ed8"
source = "git+https://github.com/servo/webxr#51477cb33fdb3bf3d5cc8b5af9e547fad9d67319"
dependencies = [
"android_injected_glue",
"bindgen",
@ -6494,7 +6494,7 @@ dependencies = [
[[package]]
name = "webxr-api"
version = "0.0.1"
source = "git+https://github.com/servo/webxr#e30ebd848c4deb95833c2fea91d7d8d34f6d8ed8"
source = "git+https://github.com/servo/webxr#51477cb33fdb3bf3d5cc8b5af9e547fad9d67319"
dependencies = [
"euclid",
"ipc-channel",

View file

@ -57,6 +57,11 @@ impl XRViewerPose {
views.push(XRView::new(global, session, &left, XREye::Left, &pose));
views.push(XRView::new(global, session, &right, XREye::Right, &pose));
},
Views::StereoCapture(left, right, third_eye) => {
views.push(XRView::new(global, session, &left, XREye::Left, &pose));
views.push(XRView::new(global, session, &right, XREye::Right, &pose));
views.push(XRView::new(global, session, &third_eye, XREye::None, &pose));
},
});
let transform = XRRigidTransform::new(global, cast_transform(pose));
let pose = reflect_dom_object(Box::new(XRViewerPose::new_inherited(&transform)), global);

View file

@ -249,8 +249,11 @@ impl XRWebGLLayerMethods for XRWebGLLayer {
Rect::new(origin, self.size().cast())
},
(XREye::None, Views::Mono(view)) => view.viewport,
(XREye::None, Views::StereoCapture(_, _, view)) => view.viewport,
(XREye::Left, Views::Stereo(view, _)) => view.viewport,
(XREye::Left, Views::StereoCapture(view, _, _)) => view.viewport,
(XREye::Right, Views::Stereo(_, view)) => view.viewport,
(XREye::Right, Views::StereoCapture(_, view, _)) => view.viewport,
_ => return None,
};