| OLD | NEW |
| 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 #ifndef WebVR_h | 5 #ifndef WebVR_h |
| 6 #define WebVR_h | 6 #define WebVR_h |
| 7 | 7 |
| 8 #include "WebCommon.h" | 8 #include "public/platform/WebCommon.h" |
| 9 #include "public/platform/WebString.h" |
| 9 | 10 |
| 10 #if BLINK_IMPLEMENTATION | 11 #if BLINK_IMPLEMENTATION |
| 11 #include "wtf/Assertions.h" | 12 #include "wtf/Assertions.h" |
| 12 #endif | 13 #endif |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 | 16 |
| 16 struct WebVRVector3 { | 17 struct WebVRVector3 { |
| 17 float x, y, z; | 18 float x, y, z; |
| 18 }; | 19 }; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 enum WebVRDeviceTypeFlags { | 81 enum WebVRDeviceTypeFlags { |
| 81 WebVRDeviceTypePosition = 1 << 1, | 82 WebVRDeviceTypePosition = 1 << 1, |
| 82 WebVRDeviceTypeHMD = 1 << 2 | 83 WebVRDeviceTypeHMD = 1 << 2 |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 // A bitfield of WebVRDeviceTypeFlags. | 86 // A bitfield of WebVRDeviceTypeFlags. |
| 86 typedef int WebVRDeviceTypeMask; | 87 typedef int WebVRDeviceTypeMask; |
| 87 | 88 |
| 88 // Describes a single VR hardware unit. May describe multiple capabilities, | 89 // Describes a single VR hardware unit. May describe multiple capabilities, |
| 89 // such as position sensors or head mounted display metrics. | 90 // such as position sensors or head mounted display metrics. |
| 90 class WebVRDevice { | 91 struct WebVRDevice { |
| 91 public: | |
| 92 static const size_t deviceNameLengthCap = 128; | |
| 93 | |
| 94 WebVRDevice() | |
| 95 : flags(0) | |
| 96 { | |
| 97 deviceName[0] = 0; | |
| 98 } | |
| 99 | |
| 100 // Index for this hardware unit. | 92 // Index for this hardware unit. |
| 101 unsigned index; | 93 unsigned index; |
| 102 // Friendly device name. | 94 // Friendly device name. |
| 103 WebUChar deviceName[deviceNameLengthCap]; | 95 WebString deviceName; |
| 104 // Identifies the capabilities of this hardware unit. | 96 // Identifies the capabilities of this hardware unit. |
| 105 WebVRDeviceTypeMask flags; | 97 WebVRDeviceTypeMask flags; |
| 106 | |
| 107 // Will only contain valid data if (flags & HasHMDDevice). | 98 // Will only contain valid data if (flags & HasHMDDevice). |
| 108 WebVRHMDInfo hmdInfo; | 99 WebVRHMDInfo hmdInfo; |
| 109 }; | 100 }; |
| 110 | 101 |
| 111 } | 102 } |
| 112 | 103 |
| 113 #endif // WebVR_h | 104 #endif // WebVR_h |
| OLD | NEW |