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

Unified Diff: Source/modules/vr/VRHardwareUnit.h

Issue 848053002: Adding WebVR interface to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed compiler warning treated as an error on Windows Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/vr/VRHardwareUnit.h
diff --git a/Source/modules/vr/VRHardwareUnit.h b/Source/modules/vr/VRHardwareUnit.h
new file mode 100644
index 0000000000000000000000000000000000000000..10463ac7673c17096cb7d076854734fa5612990f
--- /dev/null
+++ b/Source/modules/vr/VRHardwareUnit.h
@@ -0,0 +1,67 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef VRHardwareUnit_h
+#define VRHardwareUnit_h
+
+#include "modules/vr/VRFieldOfView.h"
+#include "modules/vr/VRPositionState.h"
+#include "platform/heap/Handle.h"
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+class VRDevice;
+class HMDVRDevice;
+class NavigatorVRDevice;
+class PositionSensorVRDevice;
+
+enum VREye {
+ VREyeLeft,
+ VREyeRight,
+ VREyeNone,
+};
+
+class VRHardwareUnit : public GarbageCollectedFinalized<VRHardwareUnit> {
+public:
+ VRHardwareUnit();
+ virtual ~VRHardwareUnit();
+
+ void updateFromWebVRDevice(const WebVRDevice&);
+
+ void addDevicesToVector(HeapVector<Member<VRDevice>>&);
+
+ virtual unsigned index() const { return m_index; }
+ const String& hardwareUnitId() const { return m_hardwareUnitId; }
+
+ unsigned frameIndex() const { return m_frameIndex; }
+
+ VRPositionState* getPositionState();
+
+ void setFieldOfView(VREye, VRFieldOfView*);
+ VRFieldOfView* getCurrentEyeFieldOfView(VREye) const;
+
+ HMDVRDevice* hmd() const { return m_hmd; }
+ PositionSensorVRDevice* positionSensor() const { return m_positionSensor; }
+
+ virtual void trace(Visitor*);
+
+private:
+ unsigned m_index;
+ String m_hardwareUnitId;
+
+ unsigned m_frameIndex;
+
+ Member<VRPositionState> m_positionState;
+ Member<VRFieldOfView> m_currentFOVLeft;
+ Member<VRFieldOfView> m_currentFOVRight;
+
+ // Device types
+ Member<HMDVRDevice> m_hmd;
+ Member<PositionSensorVRDevice> m_positionSensor;
+};
+
+} // namespace blink
+
+#endif // VRHardwareUnit_h

Powered by Google App Engine
This is Rietveld 408576698