Add a dummy implementation of all the XR Layer types

This commit is contained in:
Alan Jeffrey 2020-08-04 15:10:01 -05:00
parent 754019f6bc
commit d255dc9f7b
18 changed files with 337 additions and 85 deletions

View file

@ -0,0 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// TODO: Implement the layer types
// https://github.com/servo/servo/issues/27493
// https://immersive-web.github.io/layers/#xrcompositionlayer
[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
interface XRCompositionLayer : XRLayer {
// readonly attribute XRLayerLayout layout;
//
// attribute boolean blendTextureSourceAlpha;
// attribute boolean? chromaticAberrationCorrection;
// attribute float? fixedFoveation;
//
// readonly attribute boolean needsRedraw;
//
// void destroy();
};

View file

@ -0,0 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// TODO: Implement the layer types
// https://github.com/servo/servo/issues/27493
// https://immersive-web.github.io/layers/#xrcubelayer
[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
interface XRCubeLayer : XRCompositionLayer {
// attribute XRSpace space;
// attribute DOMPointReadOnly orientation;
//
// // Events
// attribute EventHandler onredraw;
};

View file

@ -0,0 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// TODO: Implement the layer types
// https://github.com/servo/servo/issues/27493
// https://immersive-web.github.io/layers/#xrcylinderlayer
[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
interface XRCylinderLayer : XRCompositionLayer {
// attribute XRSpace space;
// attribute XRRigidTransform transform;
//
// attribute float radius;
// attribute float centralAngle;
// attribute float aspectRatio;
//
// // Events
// attribute EventHandler onredraw;
};

View file

@ -0,0 +1,21 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// TODO: Implement the layer types
// https://github.com/servo/servo/issues/27493
// https://immersive-web.github.io/layers/#xrequirectlayer
[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
interface XREquirectLayer : XRCompositionLayer {
// attribute XRSpace space;
// attribute XRRigidTransform transform;
//
// attribute float radius;
// attribute float centralHorizontalAngle;
// attribute float upperVerticalAngle;
// attribute float lowerVerticalAngle;
//
// // Events
// attribute EventHandler onredraw;
};

View file

@ -5,71 +5,3 @@
// https://immersive-web.github.io/webxr/#xrlayer
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
interface XRLayer : EventTarget {};
// TODO: Implement the layer types
//
// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
// interface XRCompositionLayer : XRLayer {
// readonly attribute XRLayerLayout layout;
//
// attribute boolean blendTextureSourceAlpha;
// attribute boolean? chromaticAberrationCorrection;
// attribute float? fixedFoveation;
//
// readonly attribute boolean needsRedraw;
//
// void destroy();
// };
//
// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
// interface XRProjectionLayer : XRCompositionLayer {
// readonly attribute boolean ignoreDepthValues;
// };
//
// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
// interface XRQuadLayer : XRCompositionLayer {
// attribute XRSpace space;
// attribute XRRigidTransform transform;
//
// attribute float width;
// attribute float height;
//
// // Events
// attribute EventHandler onredraw;
// };
//
// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
// interface XRCylinderLayer : XRCompositionLayer {
// attribute XRSpace space;
// attribute XRRigidTransform transform;
//
// attribute float radius;
// attribute float centralAngle;
// attribute float aspectRatio;
//
// // Events
// attribute EventHandler onredraw;
// };
//
// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
// interface XREquirectLayer : XRCompositionLayer {
// attribute XRSpace space;
// attribute XRRigidTransform transform;
//
// attribute float radius;
// attribute float centralHorizontalAngle;
// attribute float upperVerticalAngle;
// attribute float lowerVerticalAngle;
//
// // Events
// attribute EventHandler onredraw;
// };
//
// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
// interface XRCubeLayer : XRCompositionLayer {
// attribute XRSpace space;
// attribute DOMPointReadOnly orientation;
//
// // Events
// attribute EventHandler onredraw;
// };

View file

@ -5,11 +5,11 @@
// https://immersive-web.github.io/layers/#xrmediabindingtype
[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
interface XRMediaBinding {
constructor(XRSession session);
[Throws] constructor(XRSession session);
// XRQuadLayer createQuadVideoLayer(HTMLVideoElement video, optional XRMediaLayerInit init = {});
// XRCylinderLayer createCylinderVideoLayer(HTMLVideoElement video, optional XRMediaLayerInit init = {});
// XREquirectLayer createEquirectVideoLayer(HTMLVideoElement video, optional XRMediaLayerInit init = {});
[Throws] XRQuadLayer createQuadLayer(HTMLVideoElement video, XRMediaLayerInit init);
[Throws] XRCylinderLayer createCylinderLayer(HTMLVideoElement video, XRMediaLayerInit init);
[Throws] XREquirectLayer createEquirectLayer(HTMLVideoElement video, XRMediaLayerInit init);
};
dictionary XRMediaLayerInit {

View file

@ -0,0 +1,12 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// TODO: Implement the layer types
// https://github.com/servo/servo/issues/27493
// https://immersive-web.github.io/layers/#xrprojectionlayer
[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
interface XRProjectionLayer : XRCompositionLayer {
// readonly attribute boolean ignoreDepthValues;
};

View file

@ -0,0 +1,19 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// TODO: Implement the layer types
// https://github.com/servo/servo/issues/27493
// https://immersive-web.github.io/layers/#xrquadlayer
[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
interface XRQuadLayer : XRCompositionLayer {
// attribute XRSpace space;
// attribute XRRigidTransform transform;
//
// attribute float width;
// attribute float height;
//
// // Events
// attribute EventHandler onredraw;
};

View file

@ -9,18 +9,18 @@ interface XRWebGLBinding {
// readonly attribute double nativeProjectionScaleFactor;
// XRProjectionLayer createProjectionLayer(XRTextureType textureType,
// optional XRProjectionLayerInit init);
// XRQuadLayer createQuadLayer(XRTextureType textureType,
// optional XRQuadLayerInit init);
// XRCylinderLayer createCylinderLayer(XRTextureType textureType,
// optional XRCylinderLayerInit init);
// XREquirectLayer createEquirectLayer(XRTextureType textureType,
// optional XREquirectLayerInit init);
// XRCubeLayer createCubeLayer(optional XRCubeLayerInit init);
[Throws] XRProjectionLayer createProjectionLayer(XRTextureType textureType,
optional XRProjectionLayerInit init = {});
[Throws] XRQuadLayer createQuadLayer(XRTextureType textureType,
optional XRQuadLayerInit init);
[Throws] XRCylinderLayer createCylinderLayer(XRTextureType textureType,
optional XRCylinderLayerInit init);
[Throws] XREquirectLayer createEquirectLayer(XRTextureType textureType,
optional XREquirectLayerInit init);
[Throws] XRCubeLayer createCubeLayer(optional XRCubeLayerInit init);
// XRWebGLSubImage getSubImage(XRCompositionLayer layer, XRFrame frame, optional XREye eye = "none");
// XRWebGLSubImage getViewSubImage(XRProjectionLayer layer, XRView view);
[Throws] XRWebGLSubImage getSubImage(XRCompositionLayer layer, XRFrame frame, optional XREye eye = "none");
[Throws] XRWebGLSubImage getViewSubImage(XRProjectionLayer layer, XRView view);
};
dictionary XRProjectionLayerInit {