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

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: Addressed feedback from philipj@opera.com, rebased Created 5 years, 10 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..7428f2619e1aabe054dfa1dd5d6fdf2e87f43010
--- /dev/null
+++ b/Source/modules/vr/VRHardwareUnit.h
@@ -0,0 +1,62 @@
+// Copyright 2014 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;
+
+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(double offset);
+
+ void setFieldOfView(unsigned eyeIndex, VRFieldOfView*);
sof 2015/02/24 12:35:29 Are we bounded two just left&right eyes here (now
+ VRFieldOfView* getCurrentEyeFieldOfView(unsigned eyeIndex) const;
+ virtual WebVRFieldOfView getFieldOfView(unsigned eyeIndex) 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