| 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"; |
| 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 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 SetClient(VRServiceClient client) => (uint32 numberOfConnectedDevices); | 79 SetClient(VRServiceClient client) => (uint32 numberOfConnectedDevices); |
| 78 // Inform the service that the page is listening for vrdisplayactivate events. | 80 // Inform the service that the page is listening for vrdisplayactivate events. |
| 79 SetListeningForActivate(bool listening); | 81 SetListeningForActivate(bool listening); |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 interface VRServiceClient { | 84 interface VRServiceClient { |
| 83 OnDisplayConnected(VRDisplay display, VRDisplayClient& request, | 85 OnDisplayConnected(VRDisplay display, VRDisplayClient& request, |
| 84 VRDisplayInfo displayInfo); | 86 VRDisplayInfo displayInfo); |
| 85 }; | 87 }; |
| 86 | 88 |
| 89 interface VRSubmitFrameClient { |
| 90 OnSubmitFrameTransferred(); |
| 91 OnSubmitFrameRendered(); |
| 92 }; |
| 93 |
| 87 interface VRDisplay { | 94 interface VRDisplay { |
| 88 ResetPose(); | 95 ResetPose(); |
| 89 | 96 |
| 90 RequestPresent(bool secureOrigin) => (bool success); | 97 RequestPresent(bool secureOrigin, VRSubmitFrameClient client) => (bool success
); |
| 91 ExitPresent(); | 98 ExitPresent(); |
| 92 SubmitFrame(VRPose? pose); | 99 SubmitFrame(int16 frameId, gpu.mojom.MailboxHolder mailboxHolder); |
| 93 UpdateLayerBounds(int16 frameId, VRLayerBounds leftBounds, | 100 UpdateLayerBounds(int16 frameId, VRLayerBounds leftBounds, |
| 94 VRLayerBounds rightBounds); | 101 VRLayerBounds rightBounds, int16 sourceWidth, |
| 102 int16 sourceHeight); |
| 95 GetVRVSyncProvider(VRVSyncProvider& request); | 103 GetVRVSyncProvider(VRVSyncProvider& request); |
| 96 }; | 104 }; |
| 97 | 105 |
| 98 interface VRVSyncProvider { | 106 interface VRVSyncProvider { |
| 99 enum Status { SUCCESS, RETRY }; | 107 enum Status { SUCCESS, CLOSING }; |
| 100 | 108 |
| 101 // The frameId maps a VSync to a frame arriving from the compositor. IDs will | 109 // The frameId maps a VSync to a frame arriving from the compositor. IDs will |
| 102 // be reused after the frame arrives from the compositor. Negative IDs imply | 110 // be reused after the frame arrives from the compositor. Negative IDs imply |
| 103 // no mapping. | 111 // no mapping. |
| 104 GetVSync() => (VRPose? pose, mojo.common.mojom.TimeDelta time, int16 frameId, | 112 GetVSync() => (VRPose? pose, mojo.common.mojom.TimeDelta time, int16 frameId, |
| 105 Status status); | 113 Status status); |
| 106 }; | 114 }; |
| 107 | 115 |
| 108 interface VRDisplayClient { | 116 interface VRDisplayClient { |
| 109 OnChanged(VRDisplayInfo display); | 117 OnChanged(VRDisplayInfo display); |
| 110 OnExitPresent(); | 118 OnExitPresent(); |
| 111 OnBlur(); | 119 OnBlur(); |
| 112 OnFocus(); | 120 OnFocus(); |
| 113 OnActivate(VRDisplayEventReason reason); | 121 OnActivate(VRDisplayEventReason reason); |
| 114 OnDeactivate(VRDisplayEventReason reason); | 122 OnDeactivate(VRDisplayEventReason reason); |
| 115 }; | 123 }; |
| OLD | NEW |