Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: device/vr/vr_service.mojom

Issue 2420743003: mojo VR interface simplified (Closed)
Patch Set: Address haraken@ comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // TODO : Remove this attribute with gamepad refactory.
53 string displayName; 52 uint32 index;
54 VRDisplayCapabilities capabilities; 53 string displayName;
55 VRStageParameters? stageParameters; 54 VRDisplayCapabilities capabilities;
56 VREyeParameters leftEye; 55 VRStageParameters? stageParameters;
57 VREyeParameters rightEye; 56 VREyeParameters leftEye;
57 VREyeParameters rightEye;
58 }; 58 };
59 59
60 struct VRLayerBounds { 60 struct VRLayerBounds {
61 float left; 61 float left;
62 float top; 62 float top;
63 float width; 63 float width;
64 float height; 64 float height;
65 }; 65 };
66 66
67 interface VRService { 67 interface VRService {
68 SetClient(VRServiceClient client); 68 SetClient(VRServiceClient client) => (uint32 num);
dcheng 2016/11/04 05:12:21 In a followup, it'd be better if we had a factory
shaobo.yan 2016/11/05 08:11:39 num means connectedDeviceNumber I'll update it. An
69
70 GetDisplays() => (array<VRDisplay> displays);
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 }; 69 };
80 70
81 interface VRServiceClient { 71 interface VRServiceClient {
82 OnDisplayChanged(VRDisplay display); 72 OnDisplayConnected(VRDisplay display, VRDisplayInfo displayInfo);
83 OnExitPresent(uint32 index);
84 OnDisplayConnected(VRDisplay display);
85 OnDisplayDisconnected(uint32 index);
86 }; 73 };
74
75 interface VRDisplay {
76 SetClient(VRDisplayClient client);
dcheng 2016/11/04 05:12:21 Ditto: it'd be better for this to be created throu
shaobo.yan 2016/11/05 08:11:39 Thx and I'll use TODO to follow this.
77
78 [Sync]
79 GetPose() => (VRPose? pose);
80 ResetPose();
81
82 RequestPresent(bool secureOrigin) => (bool success);
83 ExitPresent();
84 SubmitFrame(VRPose? pose);
85 UpdateLayerBounds(VRLayerBounds leftBounds, VRLayerBounds rightBounds);
86 };
87
88 interface VRDisplayClient {
89 OnDisplayChanged(VRDisplayInfo display);
90 OnExitPresent();
91 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698