OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 module device.mojom; | 5 module device.mojom; |
6 | 6 |
7 import "mojo/common/time.mojom"; | 7 import "mojo/common/time.mojom"; |
| 8 import "gpu/ipc/common/mailbox.mojom"; |
| 9 import "gpu/ipc/common/sync_token.mojom"; |
8 | 10 |
9 // A field of view, given by 4 degrees describing the view from a center point. | 11 // A field of view, given by 4 degrees describing the view from a center point. |
10 struct VRFieldOfView { | 12 struct VRFieldOfView { |
11 float upDegrees; | 13 float upDegrees; |
12 float downDegrees; | 14 float downDegrees; |
13 float leftDegrees; | 15 float leftDegrees; |
14 float rightDegrees; | 16 float rightDegrees; |
15 }; | 17 }; |
16 | 18 |
17 // A display's position, orientation, velocity, and acceleration state at the | 19 // A display's position, orientation, velocity, and acceleration state at the |
18 // given timestamp. | 20 // given timestamp. |
19 struct VRPose { | 21 struct VRPose { |
20 double timestamp; | 22 double timestamp; |
21 array<float, 4>? orientation; | 23 array<float, 4>? orientation; |
22 array<float, 3>? position; | 24 array<float, 3>? position; |
23 array<float, 3>? angularVelocity; | 25 array<float, 3>? angularVelocity; |
24 array<float, 3>? linearVelocity; | 26 array<float, 3>? linearVelocity; |
25 array<float, 3>? angularAcceleration; | 27 array<float, 3>? angularAcceleration; |
26 array<float, 3>? linearAcceleration; | 28 array<float, 3>? linearAcceleration; |
| 29 int32 surfaceId; |
| 30 int32 frameId; |
| 31 gpu.mojom.Mailbox? mailbox; |
| 32 // gpu.mojom.SyncToken syncToken; |
27 }; | 33 }; |
28 | 34 |
29 struct VRDisplayCapabilities { | 35 struct VRDisplayCapabilities { |
30 bool hasOrientation; | 36 bool hasOrientation; |
31 bool hasPosition; | 37 bool hasPosition; |
32 bool hasExternalDisplay; | 38 bool hasExternalDisplay; |
33 bool canPresent; | 39 bool canPresent; |
34 }; | 40 }; |
35 | 41 |
36 // Information about the optical properties for an eye in a VRDisplay. | 42 // Information about the optical properties for an eye in a VRDisplay. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 SetClient(VRServiceClient client) => (uint32 numberOfConnectedDevices); | 84 SetClient(VRServiceClient client) => (uint32 numberOfConnectedDevices); |
79 // Inform the service that the page is listening for vrdisplayactivate events. | 85 // Inform the service that the page is listening for vrdisplayactivate events. |
80 SetListeningForActivate(bool listening); | 86 SetListeningForActivate(bool listening); |
81 }; | 87 }; |
82 | 88 |
83 interface VRServiceClient { | 89 interface VRServiceClient { |
84 OnDisplayConnected(VRDisplay display, VRDisplayClient& request, | 90 OnDisplayConnected(VRDisplay display, VRDisplayClient& request, |
85 VRDisplayInfo displayInfo); | 91 VRDisplayInfo displayInfo); |
86 }; | 92 }; |
87 | 93 |
| 94 interface VRSubmitFrameClient { |
| 95 OnSubmitFrameTransferred(); |
| 96 OnSubmitFrameRendered(); |
| 97 }; |
| 98 |
88 interface VRDisplay { | 99 interface VRDisplay { |
89 ResetPose(); | 100 ResetPose(); |
90 | 101 |
91 RequestPresent(bool secureOrigin) => (bool success); | 102 RequestPresent(bool secureOrigin) => (bool success); |
92 ExitPresent(); | 103 ExitPresent(); |
93 SubmitFrame(VRPose? pose); | 104 SubmitFrame(VRPose? pose, VRSubmitFrameClient client); |
94 UpdateLayerBounds(int16 frameId, VRLayerBounds leftBounds, | 105 UpdateLayerBounds(int16 frameId, VRLayerBounds leftBounds, |
95 VRLayerBounds rightBounds); | 106 VRLayerBounds rightBounds); |
96 GetVRVSyncProvider(VRVSyncProvider& request); | 107 GetVRVSyncProvider(VRVSyncProvider& request); |
97 }; | 108 }; |
98 | 109 |
99 interface VRVSyncProvider { | 110 interface VRVSyncProvider { |
100 enum Status { SUCCESS, RETRY }; | 111 enum Status { SUCCESS, RETRY }; |
101 | 112 |
102 // The frameId maps a VSync to a frame arriving from the compositor. IDs will | 113 // The frameId maps a VSync to a frame arriving from the compositor. IDs will |
103 // be reused after the frame arrives from the compositor. Negative IDs imply | 114 // be reused after the frame arrives from the compositor. Negative IDs imply |
104 // no mapping. | 115 // no mapping. |
105 GetVSync() => (VRPose? pose, mojo.common.mojom.TimeDelta time, int16 frameId, | 116 GetVSync() => (VRPose? pose, mojo.common.mojom.TimeDelta time, int16 frameId, |
106 Status status); | 117 Status status); |
107 }; | 118 }; |
108 | 119 |
109 interface VRDisplayClient { | 120 interface VRDisplayClient { |
110 OnChanged(VRDisplayInfo display); | 121 OnChanged(VRDisplayInfo display); |
111 OnExitPresent(); | 122 OnExitPresent(); |
112 OnBlur(); | 123 OnBlur(); |
113 OnFocus(); | 124 OnFocus(); |
114 OnActivate(VRDisplayEventReason reason); | 125 OnActivate(VRDisplayEventReason reason); |
115 OnDeactivate(VRDisplayEventReason reason); | 126 OnDeactivate(VRDisplayEventReason reason); |
116 }; | 127 }; |
OLD | NEW |