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

Side by Side Diff: third_party/WebKit/Source/modules/vr/VRHardwareUnit.h

Issue 1918143007: Updated Blink WebVR interfaces to WebVR v1 spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webvr_mojo
Patch Set: Fixed layout test Created 4 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef VRHardwareUnit_h
6 #define VRHardwareUnit_h
7
8 #include "modules/vr/VRFieldOfView.h"
9 #include "modules/vr/VRPositionState.h"
10 #include "platform/heap/Handle.h"
11 #include "public/platform/WebThread.h"
12 #include "wtf/text/WTFString.h"
13
14 namespace blink {
15
16 class VRController;
17 class VRDevice;
18 class HMDVRDevice;
19 class NavigatorVRDevice;
20 class PositionSensorVRDevice;
21
22 enum VREye {
23 VREyeLeft,
24 VREyeRight,
25 VREyeNone,
26 };
27
28 class VRHardwareUnit : public GarbageCollectedFinalized<VRHardwareUnit>, public WebThread::TaskObserver {
29 public:
30 explicit VRHardwareUnit(NavigatorVRDevice*);
31 virtual ~VRHardwareUnit();
32
33 void updateFromWebVRDevice(const WebVRDevice&);
34
35 void addDevicesToVector(HeapVector<Member<VRDevice>>&);
36
37 virtual unsigned index() const { return m_index; }
38 const String& hardwareUnitId() const { return m_hardwareUnitId; }
39
40 unsigned frameIndex() const { return m_frameIndex; }
41
42 VRController* controller();
43
44 // VRController queries
45 VRPositionState* getSensorState();
46 VRPositionState* getImmediateSensorState(bool updateFrameIndex);
47
48 HMDVRDevice* hmd() const { return m_hmd; }
49 PositionSensorVRDevice* positionSensor() const { return m_positionSensor; }
50
51 DECLARE_VIRTUAL_TRACE();
52
53 private:
54 // TaskObserver implementation.
55 void didProcessTask() override;
56 void willProcessTask() override { }
57
58 unsigned m_index;
59 String m_hardwareUnitId;
60 unsigned m_nextDeviceId;
61
62 unsigned m_frameIndex;
63
64 Member<NavigatorVRDevice> m_navigatorVRDevice;
65 Member<VRPositionState> m_positionState;
66 bool m_canUpdatePositionState;
67
68 // Device types
69 Member<HMDVRDevice> m_hmd;
70 Member<PositionSensorVRDevice> m_positionSensor;
71 };
72
73 } // namespace blink
74
75 #endif // VRHardwareUnit_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRGetDevicesCallback.cpp ('k') | third_party/WebKit/Source/modules/vr/VRHardwareUnit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698