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

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

Issue 1701283002: Implement DOMPoint using v8 extras. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/VREyeParameters.cpp
diff --git a/third_party/WebKit/Source/modules/vr/VREyeParameters.cpp b/third_party/WebKit/Source/modules/vr/VREyeParameters.cpp
index f8861774b76b6ca3c19ece69a76a608e4d86a12e..d49c2d452269026723ed4690b0774be7e95e8f6d 100644
--- a/third_party/WebKit/Source/modules/vr/VREyeParameters.cpp
+++ b/third_party/WebKit/Source/modules/vr/VREyeParameters.cpp
@@ -4,26 +4,24 @@
#include "modules/vr/VREyeParameters.h"
-namespace blink {
+#include "bindings/core/v8/GeometryInterfaces.h"
-namespace {
+namespace blink {
-void setDomPoint(DOMPoint* point, const WebVRVector3& vec)
+ScriptValue& VREyeParameters::eyeTranslation(ScriptState* scriptState)
{
- point->setX(vec.x);
- point->setY(vec.y);
- point->setZ(vec.z);
- point->setW(1.0);
+ m_eyeTranslation = GeometryInterfaces::createDOMPoint(scriptState,
+ m_eyeTranslationVector.x,
+ m_eyeTranslationVector.y,
+ m_eyeTranslationVector.z);
+ return m_eyeTranslation;
}
-} // namespace
-
VREyeParameters::VREyeParameters()
{
m_minimumFieldOfView = new VRFieldOfView();
m_maximumFieldOfView = new VRFieldOfView();
m_recommendedFieldOfView = new VRFieldOfView();
- m_eyeTranslation = DOMPoint::create(0, 0, 0, 0);
m_currentFieldOfView = new VRFieldOfView();
m_renderRect = DOMRect::create(0, 0, 0, 0);
@@ -37,7 +35,7 @@ void VREyeParameters::setFromWebVREyeParameters(const WebVREyeParameters &state)
m_minimumFieldOfView->setFromWebVRFieldOfView(state.recommendedFieldOfView);
m_maximumFieldOfView->setFromWebVRFieldOfView(state.recommendedFieldOfView);
m_recommendedFieldOfView->setFromWebVRFieldOfView(state.recommendedFieldOfView);
- setDomPoint(m_eyeTranslation, state.eyeTranslation);
+ m_eyeTranslationVector = state.eyeTranslation;
m_currentFieldOfView->setFromWebVRFieldOfView(state.recommendedFieldOfView);
m_renderRect = DOMRect::create(state.renderRect.x, state.renderRect.y, state.renderRect.width, state.renderRect.height);
@@ -48,7 +46,6 @@ DEFINE_TRACE(VREyeParameters)
visitor->trace(m_minimumFieldOfView);
visitor->trace(m_maximumFieldOfView);
visitor->trace(m_recommendedFieldOfView);
- visitor->trace(m_eyeTranslation);
visitor->trace(m_currentFieldOfView);
visitor->trace(m_renderRect);
}
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VREyeParameters.h ('k') | third_party/WebKit/Source/modules/vr/VREyeParameters.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698