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

Unified Diff: device/vr/vr_device.h

Issue 2494733002: Reland of mojo VR interface simpified. (Closed)
Patch Set: Fix Werror 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/vr/vr_client_dispatcher.h ('k') | device/vr/vr_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/vr_device.h
diff --git a/device/vr/vr_device.h b/device/vr/vr_device.h
index 4121cfcba2268b2b4bd6b17d4bafc9d6e6a1dc0b..81bbf5e564a8ae7731e9abcfed6fec49f79c64fd 100644
--- a/device/vr/vr_device.h
+++ b/device/vr/vr_device.h
@@ -20,6 +20,8 @@ class BaseWindow;
namespace device {
class VRDeviceProvider;
+class VRDisplayImpl;
+class VRServiceImpl;
const unsigned int VR_DEVICE_LAST_ID = 0xFFFFFFFF;
@@ -31,15 +33,38 @@ class DEVICE_VR_EXPORT VRDevice {
VRDeviceProvider* provider() const { return provider_; }
unsigned int id() const { return id_; }
- virtual VRDisplayPtr GetVRDevice() = 0;
- virtual VRPosePtr GetPose() = 0;
- virtual void ResetPose() = 0;
-
- virtual bool RequestPresent(bool secure_origin);
- virtual void ExitPresent(){};
- virtual void SubmitFrame(VRPosePtr pose){};
- virtual void UpdateLayerBounds(VRLayerBoundsPtr leftBounds,
- VRLayerBoundsPtr rightBounds){};
+ virtual mojom::VRDisplayInfoPtr GetVRDevice() = 0;
+ virtual mojom::VRPosePtr GetPose(VRServiceImpl* service) = 0;
+ virtual void ResetPose(VRServiceImpl* service) = 0;
+
+ virtual bool RequestPresent(VRServiceImpl* service, bool secure_origin) = 0;
+ virtual void ExitPresent(VRServiceImpl* service) = 0;
+ virtual void SubmitFrame(VRServiceImpl* service, mojom::VRPosePtr pose) = 0;
+ virtual void UpdateLayerBounds(VRServiceImpl* service,
+ mojom::VRLayerBoundsPtr leftBounds,
+ mojom::VRLayerBoundsPtr rightBounds) = 0;
+
+ virtual void AddService(VRServiceImpl* service);
+ virtual void RemoveService(VRServiceImpl* service);
+
+ // TODO(shaobo.yan@intel.com): Checks should be done against VRDisplayImpl and
+ // the name should be considered.
+ virtual bool IsAccessAllowed(VRServiceImpl* service);
+ virtual bool IsPresentingService(VRServiceImpl* service);
+
+ virtual void OnDisplayChanged();
+ virtual void OnExitPresent(VRServiceImpl* service);
+
+ protected:
+ // Each Service have one VRDisplay with one VRDevice.
+ // TODO(shaobo.yan@intel.com): Since the VRDisplayImpl knows its VRServiceImpl
+ // we should
+ // only need to store the VRDisplayImpl.
+ using DisplayClientMap = std::map<VRServiceImpl*, VRDisplayImpl*>;
+ DisplayClientMap displays_;
+
+ // TODO(shaobo.yan@intel.com): Should track presenting VRDisplayImpl instead.
+ VRServiceImpl* presenting_service_;
private:
VRDeviceProvider* provider_;
« no previous file with comments | « device/vr/vr_client_dispatcher.h ('k') | device/vr/vr_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698