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

Side by Side Diff: Source/modules/vr/HMDVRDevice.cpp

Issue 1207513003: Some name casing corrections suggested by esprehn@ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/modules/vr/HMDVRDevice.h ('k') | Source/modules/vr/VRPositionState.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "config.h" 5 #include "config.h"
6 #include "modules/vr/HMDVRDevice.h" 6 #include "modules/vr/HMDVRDevice.h"
7 7
8 #include "core/html/canvas/WebGLRenderingContextBase.h" 8 #include "core/html/canvas/WebGLRenderingContextBase.h"
9 #include "modules/vr/VRController.h" 9 #include "modules/vr/VRController.h"
10 #include "modules/vr/VRFieldOfView.h" 10 #include "modules/vr/VRFieldOfView.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 HMDVRDevice::HMDVRDevice(VRHardwareUnit* hardwareUnit, unsigned deviceId) 14 namespace {
15 : VRDevice(hardwareUnit, deviceId)
16 {
17 m_eyeParametersLeft = VREyeParameters::create();
18 m_eyeParametersRight = VREyeParameters::create();
19 }
20 15
21 VREye HMDVRDevice::StringToVREye(const String& whichEye) 16 VREye stringToVREye(const String& whichEye)
22 { 17 {
23 if (whichEye == "left") 18 if (whichEye == "left")
24 return VREyeLeft; 19 return VREyeLeft;
25 if (whichEye == "right") 20 if (whichEye == "right")
26 return VREyeRight; 21 return VREyeRight;
27 return VREyeNone; 22 return VREyeNone;
28 } 23 }
29 24
25 } // namepspace
26
27 HMDVRDevice::HMDVRDevice(VRHardwareUnit* hardwareUnit, unsigned deviceId)
28 : VRDevice(hardwareUnit, deviceId)
29 {
30 m_eyeParametersLeft = VREyeParameters::create();
31 m_eyeParametersRight = VREyeParameters::create();
32 }
33
30 void HMDVRDevice::updateFromWebVRDevice(const WebVRDevice& device) 34 void HMDVRDevice::updateFromWebVRDevice(const WebVRDevice& device)
31 { 35 {
32 VRDevice::updateFromWebVRDevice(device); 36 VRDevice::updateFromWebVRDevice(device);
33 const WebVRHMDInfo &hmdInfo = device.hmdInfo; 37 const WebVRHMDInfo &hmdInfo = device.hmdInfo;
34 38
35 m_eyeParametersLeft->setFromWebVREyeParameters(hmdInfo.leftEye); 39 m_eyeParametersLeft->setFromWebVREyeParameters(hmdInfo.leftEye);
36 m_eyeParametersRight->setFromWebVREyeParameters(hmdInfo.rightEye); 40 m_eyeParametersRight->setFromWebVREyeParameters(hmdInfo.rightEye);
37 } 41 }
38 42
39 VREyeParameters* HMDVRDevice::getEyeParameters(const String& whichEye) 43 VREyeParameters* HMDVRDevice::getEyeParameters(const String& whichEye)
40 { 44 {
41 switch (StringToVREye(whichEye)) { 45 switch (stringToVREye(whichEye)) {
42 case VREyeLeft: 46 case VREyeLeft:
43 return m_eyeParametersLeft; 47 return m_eyeParametersLeft;
44 case VREyeRight: 48 case VREyeRight:
45 return m_eyeParametersRight; 49 return m_eyeParametersRight;
46 default: 50 default:
47 return nullptr; 51 return nullptr;
48 } 52 }
49 } 53 }
50 54
51 void HMDVRDevice::setFieldOfView(VRFieldOfView* leftFov, VRFieldOfView* rightFov ) 55 void HMDVRDevice::setFieldOfView(VRFieldOfView* leftFov, VRFieldOfView* rightFov )
52 { 56 {
53 // FIXME: Currently min == max == recommended FOV, but when that changes 57 // FIXME: Currently min == max == recommended FOV, but when that changes
54 // this function will need to perform clamping and track the set value 58 // this function will need to perform clamping and track the set value
55 } 59 }
56 60
57 DEFINE_TRACE(HMDVRDevice) 61 DEFINE_TRACE(HMDVRDevice)
58 { 62 {
59 visitor->trace(m_eyeParametersLeft); 63 visitor->trace(m_eyeParametersLeft);
60 visitor->trace(m_eyeParametersRight); 64 visitor->trace(m_eyeParametersRight);
61 65
62 VRDevice::trace(visitor); 66 VRDevice::trace(visitor);
63 } 67 }
64 68
65 } // namespace blink 69 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/vr/HMDVRDevice.h ('k') | Source/modules/vr/VRPositionState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698