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

Unified Diff: third_party/WebKit/Source/modules/vr/VRFrameData.h

Issue 2331553002: Update WebVR interface to match the 1.1 spec (Closed)
Patch Set: Addressed further feedback Created 4 years, 3 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/VRFrameData.h
diff --git a/third_party/WebKit/Source/modules/vr/VRFrameData.h b/third_party/WebKit/Source/modules/vr/VRFrameData.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed3c8f94cfc0dd2961ff1706d7b047d64efec645
--- /dev/null
+++ b/third_party/WebKit/Source/modules/vr/VRFrameData.h
@@ -0,0 +1,55 @@
+// Copyright 2016 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 VRFrameData_h
+#define VRFrameData_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/dom/DOMHighResTimeStamp.h"
+#include "core/dom/DOMTypedArray.h"
+#include "device/vr/vr_service.mojom-blink.h"
+#include "platform/heap/Handle.h"
+#include "wtf/Forward.h"
+
+namespace blink {
+
+class VREyeParameters;
+class VRPose;
+
+class VRFrameData final : public GarbageCollected<VRFrameData>, public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static VRFrameData* create()
+ {
+ return new VRFrameData();
+ }
+
+ VRFrameData();
+
+ DOMHighResTimeStamp timestamp() const { return m_timestamp; }
+ DOMFloat32Array* leftProjectionMatrix() const { return m_leftProjectionMatrix; }
+ DOMFloat32Array* leftViewMatrix() const { return m_leftViewMatrix; }
+ DOMFloat32Array* rightProjectionMatrix() const { return m_rightProjectionMatrix; }
+ DOMFloat32Array* rightViewMatrix() const { return m_rightViewMatrix; }
+ VRPose* pose() const { return m_pose; }
+
+ // Populate a the VRFrameData with a pose and the necessary eye parameters.
+ // TODO(bajones): The full frame data should be provided by the VRService,
+ // not computed here.
+ bool update(const device::blink::VRPosePtr&, VREyeParameters* leftEye, VREyeParameters* rightEye, float depthNear, float depthFar);
+
+ DECLARE_VIRTUAL_TRACE()
+
+private:
+ DOMHighResTimeStamp m_timestamp;
+ Member<DOMFloat32Array> m_leftProjectionMatrix;
+ Member<DOMFloat32Array> m_leftViewMatrix;
+ Member<DOMFloat32Array> m_rightProjectionMatrix;
+ Member<DOMFloat32Array> m_rightViewMatrix;
+ Member<VRPose> m_pose;
+};
+
+} // namespace blink
+
+#endif // VRStageParameters_h

Powered by Google App Engine
This is Rietveld 408576698