OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 enum VREye { | 5 enum VREye { |
6 "left", | 6 "left", |
7 "right" | 7 "right" |
8 }; | 8 }; |
9 | 9 |
10 // http://mozvr.github.io/webvr-spec/webvr.html#vrdisplay | 10 // http://mozvr.github.io/webvr-spec/webvr.html#vrdisplay |
11 [ | 11 [ |
12 RuntimeEnabled=WebVR | 12 RuntimeEnabled=WebVR |
13 ] interface VRDisplay { | 13 ] interface VRDisplay { |
14 // An identifier for this device unique across VRDisplays. | 14 // An identifier for this device unique across VRDisplays. |
15 readonly attribute unsigned long displayId; | 15 readonly attribute unsigned long displayId; |
16 | 16 |
17 // A user-readable name identifying the device. | 17 // A user-readable name identifying the device. |
18 readonly attribute DOMString displayName; | 18 readonly attribute DOMString displayName; |
19 | 19 |
20 readonly attribute boolean isConnected; | 20 readonly attribute boolean isConnected; |
21 readonly attribute boolean isPresenting; | 21 readonly attribute boolean isPresenting; |
22 | 22 |
23 // [Constant]? | 23 // [Constant]? |
24 readonly attribute VRDisplayCapabilities capabilities; | 24 readonly attribute VRDisplayCapabilities capabilities; |
25 | 25 |
26 readonly attribute VRStageParameters stageParameters; | 26 readonly attribute VRStageParameters stageParameters; |
27 | 27 |
| 28 boolean getFrameData(VRFrameData frameData); |
28 VRPose getPose(); | 29 VRPose getPose(); |
29 VRPose getImmediatePose(); | |
30 void resetPose(); | 30 void resetPose(); |
31 | 31 |
| 32 attribute double depthNear; |
| 33 attribute double depthFar; |
| 34 |
32 VREyeParameters getEyeParameters(VREye whichEye); | 35 VREyeParameters getEyeParameters(VREye whichEye); |
33 | 36 |
34 long requestAnimationFrame(FrameRequestCallback callback); | 37 long requestAnimationFrame(FrameRequestCallback callback); |
35 void cancelAnimationFrame(long handle); | 38 void cancelAnimationFrame(long handle); |
36 | 39 |
37 // Begin presenting to the VRDisplay. Must be called in response to a user g
esture. | 40 // Begin presenting to the VRDisplay. Must be called in response to a user g
esture. |
38 // Repeat calls while already presenting will update the VRLayer being displ
ayed. | 41 // Repeat calls while already presenting will update the VRLayer being displ
ayed. |
39 [CallWith=ScriptState] Promise requestPresent(sequence<VRLayer> layers); | 42 [CallWith=ScriptState] Promise requestPresent(sequence<VRLayer> layers); |
40 | 43 |
41 // Stops presenting to the VRDisplay. | 44 // Stops presenting to the VRDisplay. |
42 [CallWith=ScriptState] Promise exitPresent(); | 45 [CallWith=ScriptState] Promise exitPresent(); |
43 | 46 |
44 // Get the sources currently being presented. | 47 // Get the sources currently being presented. |
45 sequence<VRLayer> getLayers(); | 48 sequence<VRLayer> getLayers(); |
46 | 49 |
47 // The VRLayer provided to the `VRDisplay` will be captured and presented | 50 // The VRLayer provided to the `VRDisplay` will be captured and presented |
48 // in the HMD. Calling this function has the same effect on the source | 51 // in the HMD. Calling this function has the same effect on the source |
49 // canvas as any other operation that uses its source image, and canvases | 52 // canvas as any other operation that uses its source image, and canvases |
50 // created without preserveDrawingBuffer set to true will be cleared. | 53 // created without preserveDrawingBuffer set to true will be cleared. |
51 void submitFrame(optional VRPose pose = null); | 54 void submitFrame(); |
52 }; | 55 }; |
OLD | NEW |