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_holder.mojom"; | |
9 import "gpu/ipc/common/sync_token.mojom"; | |
10 | 8 |
11 // A field of view, given by 4 degrees describing the view from a center point. | 9 // A field of view, given by 4 degrees describing the view from a center point. |
12 struct VRFieldOfView { | 10 struct VRFieldOfView { |
13 float upDegrees; | 11 float upDegrees; |
14 float downDegrees; | 12 float downDegrees; |
15 float leftDegrees; | 13 float leftDegrees; |
16 float rightDegrees; | 14 float rightDegrees; |
17 }; | 15 }; |
18 | 16 |
19 // A display's position, orientation, velocity, and acceleration state at the | 17 // A display's position, orientation, velocity, and acceleration state at the |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 SetClient(VRServiceClient client) => (uint32 numberOfConnectedDevices); | 77 SetClient(VRServiceClient client) => (uint32 numberOfConnectedDevices); |
80 // Inform the service that the page is listening for vrdisplayactivate events. | 78 // Inform the service that the page is listening for vrdisplayactivate events. |
81 SetListeningForActivate(bool listening); | 79 SetListeningForActivate(bool listening); |
82 }; | 80 }; |
83 | 81 |
84 interface VRServiceClient { | 82 interface VRServiceClient { |
85 OnDisplayConnected(VRDisplay display, VRDisplayClient& request, | 83 OnDisplayConnected(VRDisplay display, VRDisplayClient& request, |
86 VRDisplayInfo displayInfo); | 84 VRDisplayInfo displayInfo); |
87 }; | 85 }; |
88 | 86 |
89 interface VRSubmitFrameClient { | |
90 OnSubmitFrameTransferred(); | |
91 OnSubmitFrameRendered(); | |
92 }; | |
93 | |
94 interface VRDisplay { | 87 interface VRDisplay { |
95 ResetPose(); | 88 ResetPose(); |
96 | 89 |
97 RequestPresent(bool secureOrigin, VRSubmitFrameClient client) => (bool success
); | 90 RequestPresent(bool secureOrigin) => (bool success); |
98 ExitPresent(); | 91 ExitPresent(); |
99 SubmitFrame(int16 frameId, gpu.mojom.MailboxHolder mailboxHolder); | 92 SubmitFrame(VRPose? pose); |
100 UpdateLayerBounds(int16 frameId, VRLayerBounds leftBounds, | 93 UpdateLayerBounds(int16 frameId, VRLayerBounds leftBounds, |
101 VRLayerBounds rightBounds, int16 sourceWidth, | 94 VRLayerBounds rightBounds); |
102 int16 sourceHeight); | |
103 GetVRVSyncProvider(VRVSyncProvider& request); | 95 GetVRVSyncProvider(VRVSyncProvider& request); |
104 }; | 96 }; |
105 | 97 |
106 interface VRVSyncProvider { | 98 interface VRVSyncProvider { |
107 enum Status { SUCCESS, CLOSING }; | 99 enum Status { SUCCESS, RETRY }; |
108 | 100 |
109 // The frameId maps a VSync to a frame arriving from the compositor. IDs will | 101 // The frameId maps a VSync to a frame arriving from the compositor. IDs will |
110 // be reused after the frame arrives from the compositor. Negative IDs imply | 102 // be reused after the frame arrives from the compositor. Negative IDs imply |
111 // no mapping. | 103 // no mapping. |
112 GetVSync() => (VRPose? pose, mojo.common.mojom.TimeDelta time, int16 frameId, | 104 GetVSync() => (VRPose? pose, mojo.common.mojom.TimeDelta time, int16 frameId, |
113 Status status); | 105 Status status); |
114 }; | 106 }; |
115 | 107 |
116 interface VRDisplayClient { | 108 interface VRDisplayClient { |
117 OnChanged(VRDisplayInfo display); | 109 OnChanged(VRDisplayInfo display); |
118 OnExitPresent(); | 110 OnExitPresent(); |
119 OnBlur(); | 111 OnBlur(); |
120 OnFocus(); | 112 OnFocus(); |
121 OnActivate(VRDisplayEventReason reason); | 113 OnActivate(VRDisplayEventReason reason); |
122 OnDeactivate(VRDisplayEventReason reason); | 114 OnDeactivate(VRDisplayEventReason reason); |
123 }; | 115 }; |
OLD | NEW |