| 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 // fou
nd in the LICENSE file. | 2 // Use of this source code is governed by a BSD-style license that can be // fou
nd in the LICENSE file. |
| 3 | 3 |
| 4 module device.mojom; | 4 module device.mojom; |
| 5 | 5 |
| 6 // 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. |
| 7 struct VRFieldOfView { | 7 struct VRFieldOfView { |
| 8 float upDegrees; | 8 float upDegrees; |
| 9 float downDegrees; | 9 float downDegrees; |
| 10 float leftDegrees; | 10 float leftDegrees; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 VREyeParameters rightEye; | 56 VREyeParameters rightEye; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 struct VRLayerBounds { | 59 struct VRLayerBounds { |
| 60 float left; | 60 float left; |
| 61 float top; | 61 float top; |
| 62 float width; | 62 float width; |
| 63 float height; | 63 float height; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 enum VRDisplayEventReason { |
| 67 NONE = 0, |
| 68 NAVIGATION = 1, |
| 69 MOUNTED = 2, |
| 70 UNMOUNTED = 3 |
| 71 }; |
| 72 |
| 66 // TODO(shaobo.yan@intel.com) : Add comments to describe these interfaces about
how to use and where they live. | 73 // TODO(shaobo.yan@intel.com) : Add comments to describe these interfaces about
how to use and where they live. |
| 67 interface VRService { | 74 interface VRService { |
| 68 // TODO(shaobo.yan@intel.com) : Use a factory function which took a VRServiceC
lient | 75 // TODO(shaobo.yan@intel.com) : Use a factory function which took a VRServiceC
lient |
| 69 // so we would never have a half-initialized VRService. | 76 // so we would never have a half-initialized VRService. |
| 70 SetClient(VRServiceClient client) => (uint32 numberOfConnectedDevices); | 77 SetClient(VRServiceClient client) => (uint32 numberOfConnectedDevices); |
| 71 }; | 78 }; |
| 72 | 79 |
| 73 interface VRServiceClient { | 80 interface VRServiceClient { |
| 74 OnDisplayConnected(VRDisplay display, VRDisplayClient& request, VRDisplayInfo
displayInfo); | 81 OnDisplayConnected(VRDisplay display, VRDisplayClient& request, VRDisplayInfo
displayInfo); |
| 75 }; | 82 }; |
| 76 | 83 |
| 77 interface VRDisplay { | 84 interface VRDisplay { |
| 78 | |
| 79 [Sync] | 85 [Sync] |
| 80 GetPose() => (VRPose? pose); | 86 GetPose() => (VRPose? pose); |
| 81 ResetPose(); | 87 ResetPose(); |
| 82 | 88 |
| 83 RequestPresent(bool secureOrigin) => (bool success); | 89 RequestPresent(bool secureOrigin) => (bool success); |
| 84 ExitPresent(); | 90 ExitPresent(); |
| 85 SubmitFrame(VRPose? pose); | 91 SubmitFrame(VRPose? pose); |
| 86 UpdateLayerBounds(VRLayerBounds leftBounds, VRLayerBounds rightBounds); | 92 UpdateLayerBounds(VRLayerBounds leftBounds, VRLayerBounds rightBounds); |
| 87 }; | 93 }; |
| 88 | 94 |
| 89 interface VRDisplayClient { | 95 interface VRDisplayClient { |
| 90 OnDisplayChanged(VRDisplayInfo display); | 96 OnChanged(VRDisplayInfo display); |
| 91 OnExitPresent(); | 97 OnExitPresent(); |
| 92 OnDisplayBlur(); | 98 OnBlur(); |
| 93 OnDisplayFocus(); | 99 OnFocus(); |
| 100 OnActivate(VRDisplayEventReason reason); |
| 101 OnDeactivate(VRDisplayEventReason reason); |
| 94 }; | 102 }; |
| OLD | NEW |