mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update WebXR Layer IDL, and matching changes to the Rust code.
This commit is contained in:
parent
092dcaf2e6
commit
bf7f4eae31
13 changed files with 235 additions and 325 deletions
|
@ -2,59 +2,74 @@
|
|||
* 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/. */
|
||||
|
||||
// https://immersive-web.github.io/layers/#xrlayertype
|
||||
[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
|
||||
interface XRLayer {
|
||||
// attribute boolean blendTextureSourceAlpha;
|
||||
// attribute boolean chromaticAberrationCorrection;
|
||||
// https://immersive-web.github.io/webxr/#xrlayer
|
||||
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
|
||||
interface XRLayer : EventTarget {};
|
||||
|
||||
void destroy();
|
||||
};
|
||||
//
|
||||
// TODO: Implement the layer types
|
||||
//
|
||||
// [SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
|
||||
// interface XRProjectionLayer : XRLayer {
|
||||
// [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 : XRLayer {
|
||||
// readonly attribute XRLayerLayout layout;
|
||||
// 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 : XRLayer {
|
||||
// readonly attribute XRLayerLayout layout;
|
||||
// attribute XRReferenceSpace referenceSpace;
|
||||
//
|
||||
// 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 : XRLayer {
|
||||
// readonly attribute XRLayerLayout layout;
|
||||
// attribute XRReferenceSpace referenceSpace;
|
||||
//
|
||||
// interface XREquirectLayer : XRCompositionLayer {
|
||||
// attribute XRSpace space;
|
||||
// attribute XRRigidTransform transform;
|
||||
//
|
||||
// attribute float radius;
|
||||
// attribute float scaleX;
|
||||
// attribute float scaleY;
|
||||
// attribute float biasX;
|
||||
// attribute float biasY;
|
||||
// attribute float centralHorizontalAngle;
|
||||
// attribute float upperVerticalAngle;
|
||||
// attribute float lowerVerticalAngle;
|
||||
//
|
||||
// // Events
|
||||
// attribute EventHandler onredraw;
|
||||
// };
|
||||
//
|
||||
// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
|
||||
// interface XRCubeLayer : XRLayer {
|
||||
// readonly attribute XRLayerLayout layout;
|
||||
// attribute XRReferenceSpace referenceSpace;
|
||||
// interface XRCubeLayer : XRCompositionLayer {
|
||||
// attribute XRSpace space;
|
||||
// attribute DOMPointReadOnly orientation;
|
||||
//
|
||||
// attribute DOMPoint orientation;
|
||||
// // Events
|
||||
// attribute EventHandler onredraw;
|
||||
// };
|
||||
|
|
15
components/script/dom/webidls/XRLayerEvent.webidl
Normal file
15
components/script/dom/webidls/XRLayerEvent.webidl
Normal file
|
@ -0,0 +1,15 @@
|
|||
/* 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/. */
|
||||
|
||||
// https://immersive-web.github.io/layers/#xrlayerevent-interface
|
||||
|
||||
// [SecureContext, Exposed=Window]
|
||||
// interface XRLayerEvent : Event {
|
||||
// constructor(DOMString type, XRLayerEventInit eventInitDict);
|
||||
// [SameObject] readonly attribute XRLayer layer;
|
||||
// };
|
||||
|
||||
dictionary XRLayerEventInit : EventInit {
|
||||
required XRLayer layer;
|
||||
};
|
|
@ -13,6 +13,7 @@ interface XRMediaBinding {
|
|||
};
|
||||
|
||||
dictionary XRMediaLayerInit {
|
||||
required XRSpace space;
|
||||
XRLayerLayout layout = "mono";
|
||||
boolean invertStereo = false;
|
||||
};
|
||||
|
|
|
@ -2,16 +2,14 @@
|
|||
* 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/. */
|
||||
|
||||
typedef (XRWebGLLayer or XRLayer) XRGenericLayer;
|
||||
|
||||
// https://immersive-web.github.io/webxr/#xrrenderstate-interface
|
||||
|
||||
dictionary XRRenderStateInit {
|
||||
double depthNear;
|
||||
double depthFar;
|
||||
double inlineVerticalFieldOfView;
|
||||
XRWebGLLayer baseLayer;
|
||||
sequence<XRGenericLayer> layers;
|
||||
XRWebGLLayer? baseLayer;
|
||||
sequence<XRLayer>? layers;
|
||||
};
|
||||
|
||||
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] interface XRRenderState {
|
||||
|
@ -19,4 +17,8 @@ dictionary XRRenderStateInit {
|
|||
readonly attribute double depthFar;
|
||||
readonly attribute double? inlineVerticalFieldOfView;
|
||||
readonly attribute XRWebGLLayer? baseLayer;
|
||||
|
||||
// https://immersive-web.github.io/layers/#xrrenderstatechanges
|
||||
// workaround until we have FrozenArray
|
||||
readonly attribute /* FrozenArray<XRLayer> */ any layers;
|
||||
};
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
// https://immersive-web.github.io/layers/#xrsubimagetype
|
||||
[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
|
||||
interface XRSubImage {
|
||||
readonly attribute XRViewport viewport;
|
||||
[SameObject] readonly attribute XRViewport viewport;
|
||||
};
|
||||
|
|
|
@ -9,14 +9,18 @@ interface XRWebGLBinding {
|
|||
|
||||
// readonly attribute double nativeProjectionScaleFactor;
|
||||
|
||||
// XRProjectionLayer createProjectionLayer(GLenum textureTarget, optional XRProjectionLayerInit init = {});
|
||||
// XRQuadLayer createQuadLayer(GLenum textureTarget, XRLayerInit init);
|
||||
// XRCylinderLayer createCylinderLayer(GLenum textureTarget, XRLayerInit init);
|
||||
// XREquirectLayer createEquirectLayer(GLenum textureTarget, XRLayerInit init);
|
||||
// XRCubeLayer createCubeLayer(XRLayerInit init);
|
||||
// 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);
|
||||
|
||||
XRWebGLSubImage? getSubImage(XRLayer layer, XRFrame frame); // for mono layers
|
||||
XRWebGLSubImage? getViewSubImage(XRLayer layer, XRView view); // for stereo layers
|
||||
// XRWebGLSubImage getSubImage(XRCompositionLayer layer, XRFrame frame, optional XREye eye = "none");
|
||||
// XRWebGLSubImage getViewSubImage(XRProjectionLayer layer, XRView view);
|
||||
};
|
||||
|
||||
dictionary XRProjectionLayerInit {
|
||||
|
@ -26,19 +30,54 @@ dictionary XRProjectionLayerInit {
|
|||
double scaleFactor = 1.0;
|
||||
};
|
||||
|
||||
dictionary XRQuadLayerInit : XRLayerInit {
|
||||
XRRigidTransform? transform;
|
||||
float width = 1.0;
|
||||
float height = 1.0;
|
||||
boolean isStatic = false;
|
||||
};
|
||||
|
||||
dictionary XRCylinderLayerInit : XRLayerInit {
|
||||
XRRigidTransform? transform;
|
||||
float radius = 2.0;
|
||||
float centralAngle = 0.78539;
|
||||
float aspectRatio = 2.0;
|
||||
boolean isStatic = false;
|
||||
};
|
||||
|
||||
dictionary XREquirectLayerInit : XRLayerInit {
|
||||
XRRigidTransform? transform;
|
||||
float radius = 0;
|
||||
float centralHorizontalAngle = 6.28318;
|
||||
float upperVerticalAngle = 1.570795;
|
||||
float lowerVerticalAngle = -1.570795;
|
||||
boolean isStatic = false;
|
||||
};
|
||||
|
||||
dictionary XRCubeLayerInit : XRLayerInit {
|
||||
DOMPointReadOnly? orientation;
|
||||
boolean isStatic = false;
|
||||
};
|
||||
|
||||
dictionary XRLayerInit {
|
||||
required unsigned long pixelWidth;
|
||||
required unsigned long pixelHeight;
|
||||
required XRSpace space;
|
||||
required unsigned long viewPixelWidth;
|
||||
required unsigned long viewPixelHeight;
|
||||
XRLayerLayout layout = "mono";
|
||||
boolean depth = false; // This is a change from typical WebGL initialization, but feels appropriate.
|
||||
boolean depth = false;
|
||||
boolean stencil = false;
|
||||
boolean alpha = true;
|
||||
};
|
||||
|
||||
enum XRTextureType {
|
||||
"texture",
|
||||
"texture-array"
|
||||
};
|
||||
|
||||
enum XRLayerLayout {
|
||||
"default",
|
||||
"mono",
|
||||
"stereo",
|
||||
"stereo-left-right",
|
||||
"stereo-top-bottom"
|
||||
};
|
||||
|
||||
|
|
|
@ -17,19 +17,19 @@ dictionary XRWebGLLayerInit {
|
|||
};
|
||||
|
||||
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
|
||||
interface XRWebGLLayer {
|
||||
interface XRWebGLLayer: XRLayer {
|
||||
[Throws] constructor(XRSession session,
|
||||
XRWebGLRenderingContext context,
|
||||
optional XRWebGLLayerInit layerInit = {});
|
||||
// // Attributes
|
||||
// Attributes
|
||||
readonly attribute boolean antialias;
|
||||
readonly attribute boolean ignoreDepthValues;
|
||||
|
||||
readonly attribute WebGLFramebuffer? framebuffer;
|
||||
[SameObject] readonly attribute WebGLFramebuffer? framebuffer;
|
||||
readonly attribute unsigned long framebufferWidth;
|
||||
readonly attribute unsigned long framebufferHeight;
|
||||
|
||||
// // Methods
|
||||
// Methods
|
||||
XRViewport? getViewport(XRView view);
|
||||
|
||||
// // Static Methods
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue