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

Unified Diff: third_party/WebKit/Source/modules/vr/VRPositionState.cpp

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/vr/VRPositionState.cpp
diff --git a/third_party/WebKit/Source/modules/vr/VRPositionState.cpp b/third_party/WebKit/Source/modules/vr/VRPositionState.cpp
deleted file mode 100644
index 0d748cb79830d51b51ade0e2b44ac2410f7b76f4..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/modules/vr/VRPositionState.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// 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.
-
-#include "modules/vr/VRPositionState.h"
-
-namespace blink {
-
-namespace {
-
-DOMPoint* vecToDomPoint(const WebVRVector4& vec, bool valid)
-{
- if (valid)
- return DOMPoint::create(vec.x, vec.y, vec.z, vec.w);
- return nullptr;
-}
-DOMPoint* vecToDomPoint(const WebVRVector3& vec, bool valid)
-{
- if (valid)
- return DOMPoint::create(vec.x, vec.y, vec.z, 1.0);
- return nullptr;
-}
-
-} // namespace
-
-VRPositionState::VRPositionState()
- : m_timeStamp(0.0)
-{
-}
-
-void VRPositionState::setState(const WebHMDSensorState &state)
-{
- m_timeStamp = state.timestamp;
- m_orientation = vecToDomPoint(state.orientation, state.flags & WebVRSensorStateOrientation);
- m_position = vecToDomPoint(state.position, state.flags & WebVRSensorStatePosition);
- m_angularVelocity = vecToDomPoint(state.angularVelocity, state.flags & WebVRSensorStateAngularVelocity);
- m_linearVelocity = vecToDomPoint(state.linearVelocity, state.flags & WebVRSensorStateLinearVelocity);
- m_angularAcceleration = vecToDomPoint(state.angularAcceleration, state.flags & WebVRSensorStateAngularAcceleration);
- m_linearAcceleration = vecToDomPoint(state.linearAcceleration, state.flags & WebVRSensorStateLinearAcceleration);
-}
-
-DEFINE_TRACE(VRPositionState)
-{
- visitor->trace(m_orientation);
- visitor->trace(m_position);
- visitor->trace(m_angularVelocity);
- visitor->trace(m_linearVelocity);
- visitor->trace(m_angularAcceleration);
- visitor->trace(m_linearAcceleration);
-}
-
-} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRPositionState.h ('k') | third_party/WebKit/Source/modules/vr/VRPositionState.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698