mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
webxr: Update XRView to latest spec (#33145)
* Add recommendedViewportScale and requestViewportScale Signed-off-by: Daniel Adams <msub2official@gmail.com> * Remove currently unused internal slots Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
parent
75b817cca3
commit
8e224cb4d3
7 changed files with 47 additions and 194 deletions
|
@ -316,7 +316,7 @@ impl XRWebGLLayerMethods for XRWebGLLayer {
|
|||
let index = view.viewport_index();
|
||||
|
||||
let viewport = self.session().with_session(|s| {
|
||||
// Inline sssions
|
||||
// Inline sessions
|
||||
if s.viewports().is_empty() {
|
||||
Rect::from_size(self.size().to_i32())
|
||||
} else {
|
||||
|
@ -324,6 +324,11 @@ impl XRWebGLLayerMethods for XRWebGLLayer {
|
|||
}
|
||||
});
|
||||
|
||||
// NOTE: According to spec, viewport sizes should be recalculated here if the
|
||||
// requested viewport scale has changed. However, existing browser implementations
|
||||
// don't seem to do this for stereoscopic immersive sessions.
|
||||
// Revisit if Servo gets support for handheld AR/VR via ARCore/ARKit
|
||||
|
||||
Some(XRViewport::new(&self.global(), viewport))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue