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

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

Issue 2420743003: mojo VR interface simplified (Closed)
Patch Set: Address bajones@ comments and some clean up Created 4 years, 2 months 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
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module device; 5 module device;
6 6
7 // A field of view, given by 4 degrees describing the view from a center point. 7 // A field of view, given by 4 degrees describing the view from a center point.
8 struct VRFieldOfView { 8 struct VRFieldOfView {
9 float upDegrees; 9 float upDegrees;
10 float downDegrees; 10 float downDegrees;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 uint32 renderHeight; 42 uint32 renderHeight;
43 }; 43 };
44 44
45 struct VRStageParameters { 45 struct VRStageParameters {
46 array<float, 16> standingTransform; 46 array<float, 16> standingTransform;
47 float sizeX; 47 float sizeX;
48 float sizeZ; 48 float sizeZ;
49 }; 49 };
50 50
51 struct VRDisplay { 51 struct VRDisplay {
52 uint32 index; 52 uint32 index;
leonhsl(Using Gerrit) 2016/10/17 09:03:29 I suppose our target is to avoid transferring the
shaobo.yan 2016/10/18 01:10:48 Since WebVR spec need each VRDisplay should have a
leonhsl(Using Gerrit) 2016/10/18 07:12:10 This is not requested by mojo. I think one motivat
53 string displayName; 53 string displayName;
54 VRDisplayCapabilities capabilities; 54 VRDisplayCapabilities capabilities;
55 VRStageParameters? stageParameters; 55 VRStageParameters? stageParameters;
56 VREyeParameters leftEye; 56 VREyeParameters leftEye;
57 VREyeParameters rightEye; 57 VREyeParameters rightEye;
58 }; 58 };
59 59
60 struct VRDisplayWithService {
61 VRDisplay? display;
leonhsl(Using Gerrit) 2016/10/17 09:03:29 Does it make sense when VRDisplay is null? For wha
62 VRDeviceService? service;
leonhsl(Using Gerrit) 2016/10/17 09:03:29 Same question with above, what scenario for the nu
shaobo.yan 2016/10/18 01:10:48 The VRDisplay should not be nullptr but the VRDevi
63 };
64
60 struct VRLayerBounds { 65 struct VRLayerBounds {
61 float left; 66 float left;
62 float top; 67 float top;
63 float width; 68 float width;
64 float height; 69 float height;
65 }; 70 };
66 71
67 interface VRService { 72 interface VRService {
68 SetClient(VRServiceClient client); 73 GetDisplays() => (array<VRDisplayWithService> displays);
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 }; 74 };
80 75
81 interface VRServiceClient { 76 interface VRDeviceService {
leonhsl(Using Gerrit) 2016/10/17 09:03:29 We should avoid such interface naming as XXXServic
shaobo.yan 2016/10/18 01:10:48 Oh, thx for the info ! We already have a class nam
leonhsl(Using Gerrit) 2016/10/18 07:12:10 You could change 'module device' to 'module device
77 RegisterDisplayService(VRDisplayService display_service);
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 //NOTE: this interface will be held by each VRDevice and VRDisplay pair.
90 interface VRDisplayService {
leonhsl(Using Gerrit) 2016/10/17 09:03:29 Naming change: to 'VRDisplay' or 'VRDeviceClient'
shaobo.yan 2016/10/18 01:10:48 This interface is used by VRDevice to inform event
82 OnDisplayChanged(VRDisplay display); 91 OnDisplayChanged(VRDisplay display);
83 OnExitPresent(uint32 index); 92 OnExitPresent();
84 OnDisplayConnected(VRDisplay display); 93 OnDisplayConnected(VRDisplay display);
85 OnDisplayDisconnected(uint32 index); 94 OnDisplayDisconnected();
86 }; 95 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698