Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various webxr WPT fixes #25259

Merged
merged 11 commits into from Dec 13, 2019

Construct viewports for inline sessions

  • Loading branch information
Manishearth committed Dec 12, 2019
commit fe7cbd784335d8a5a08c4fe8dea0d5825856e0a3
@@ -20,7 +20,7 @@ use crate::dom::xrview::XRView;
use crate::dom::xrviewport::XRViewport;
use canvas_traits::webgl::WebGLFramebufferId;
use dom_struct::dom_struct;
use euclid::Size2D;
use euclid::{Point2D, Rect, Size2D};
use std::convert::TryInto;
use webxr_api::SwapChainId as WebXRSwapChainId;
use webxr_api::{Viewport, Views};
@@ -211,11 +211,13 @@ impl XRWebGLLayerMethods for XRWebGLLayer {
let views = self.session.with_session(|s| s.views().clone());

let viewport = match (view.Eye(), views) {
(XREye::None, Views::Inline) => {
let origin = Point2D::new(0, 0);
Rect::new(origin, self.size().cast())
},
(XREye::None, Views::Mono(view)) => view.viewport,
(XREye::Left, Views::Stereo(view, _)) => view.viewport,
(XREye::Right, Views::Stereo(_, view)) => view.viewport,
// The spec doesn't really say what to do in this case
// https://github.com/immersive-web/webxr/issues/769
_ => return None,
};

This file was deleted.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.