| 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 // fou
nd in the LICENSE file. |
| 3 // found in the LICENSE file. | |
| 4 | 3 |
| 5 module device; | 4 module device.mojom; |
| 6 | 5 |
| 7 // A field of view, given by 4 degrees describing the view from a center point. | 6 // A field of view, given by 4 degrees describing the view from a center point. |
| 8 struct VRFieldOfView { | 7 struct VRFieldOfView { |
| 9 float upDegrees; | 8 float upDegrees; |
| 10 float downDegrees; | 9 float downDegrees; |
| 11 float leftDegrees; | 10 float leftDegrees; |
| 12 float rightDegrees; | 11 float rightDegrees; |
| 13 }; | 12 }; |
| 14 | 13 |
| 15 // A display's position, orientation, velocity, and acceleration state at the | 14 // A display's position, orientation, velocity, and acceleration state at the |
| (...skipping 25 matching lines...) Expand all Loading... |
| 41 uint32 renderWidth; | 40 uint32 renderWidth; |
| 42 uint32 renderHeight; | 41 uint32 renderHeight; |
| 43 }; | 42 }; |
| 44 | 43 |
| 45 struct VRStageParameters { | 44 struct VRStageParameters { |
| 46 array<float, 16> standingTransform; | 45 array<float, 16> standingTransform; |
| 47 float sizeX; | 46 float sizeX; |
| 48 float sizeZ; | 47 float sizeZ; |
| 49 }; | 48 }; |
| 50 | 49 |
| 51 struct VRDisplay { | 50 struct VRDisplayInfo { |
| 52 uint32 index; | 51 uint32 index; |
| 53 string displayName; | 52 string displayName; |
| 54 VRDisplayCapabilities capabilities; | 53 VRDisplayCapabilities capabilities; |
| 55 VRStageParameters? stageParameters; | 54 VRStageParameters? stageParameters; |
| 56 VREyeParameters leftEye; | 55 VREyeParameters leftEye; |
| 57 VREyeParameters rightEye; | 56 VREyeParameters rightEye; |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 struct VRLayerBounds { | 59 struct VRLayerBounds { |
| 61 float left; | 60 float left; |
| 62 float top; | 61 float top; |
| 63 float width; | 62 float width; |
| 64 float height; | 63 float height; |
| 65 }; | 64 }; |
| 66 | 65 |
| 66 // TODO(shaobo.yan@intel.com) : Add comments to describe these interfaces about
how to use and where they live. |
| 67 interface VRService { | 67 interface VRService { |
| 68 SetClient(VRServiceClient client); | 68 // TODO(shaobo.yan@intel.com) : Use a factory function which took a VRServiceC
lient |
| 69 | 69 // so we would never have a half-initialized VRService. |
| 70 GetDisplays() => (array<VRDisplay> displays); | 70 SetClient(VRServiceClient client) => (uint32 numberOfConnectedDevices); |
| 71 [Sync] | |
| 72 GetPose(uint32 index) => (VRPose? pose); | |
| 73 ResetPose(uint32 index); | |
| 74 | |
| 75 RequestPresent(uint32 index, bool secureOrigin) => (bool success); | |
| 76 ExitPresent(uint32 index); | |
| 77 SubmitFrame(uint32 index, VRPose? pose); | |
| 78 UpdateLayerBounds(uint32 index, VRLayerBounds leftBounds, VRLayerBounds rightB
ounds); | |
| 79 }; | 71 }; |
| 80 | 72 |
| 81 interface VRServiceClient { | 73 interface VRServiceClient { |
| 82 OnDisplayChanged(VRDisplay display); | 74 OnDisplayConnected(VRDisplay display, VRDisplayClient& request, VRDisplayInfo
displayInfo); |
| 83 OnExitPresent(uint32 index); | |
| 84 OnDisplayConnected(VRDisplay display); | |
| 85 OnDisplayDisconnected(uint32 index); | |
| 86 }; | 75 }; |
| 76 |
| 77 interface VRDisplay { |
| 78 |
| 79 [Sync] |
| 80 GetPose() => (VRPose? pose); |
| 81 ResetPose(); |
| 82 |
| 83 RequestPresent(bool secureOrigin) => (bool success); |
| 84 ExitPresent(); |
| 85 SubmitFrame(VRPose? pose); |
| 86 UpdateLayerBounds(VRLayerBounds leftBounds, VRLayerBounds rightBounds); |
| 87 }; |
| 88 |
| 89 interface VRDisplayClient { |
| 90 OnDisplayChanged(VRDisplayInfo display); |
| 91 OnExitPresent(); |
| 92 }; |
| OLD | NEW |