Commit 3cd13413 authored by Byoungkown's avatar Byoungkown Committed by Commit Bot

[WebXR] Update using XREye instead of VREye

As following the spec[1] at XRView, The eye has changed to use XREye
instead of VREye. And it is nullable.

[1] : https://immersive-web.github.io/webxr/#xrview-interface

Bug: None
Cq-Include-Trybots: luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ib8e698f714ea107bc0ac9a275a6466d419a067e3
Reviewed-on: https://chromium-review.googlesource.com/1180629Reviewed-by: default avatarBrandon Jones <bajones@chromium.org>
Commit-Queue: Byoungkwon Ko <codeimpl@gmail.com>
Cr-Commit-Position: refs/heads/master@{#584656}
parent ddee07ae
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
namespace blink { namespace blink {
XRView::XRView(XRSession* session, Eye eye) XRView::XRView(XRSession* session, XREye eye)
: eye_(eye), : eye_(eye),
session_(session), session_(session),
projection_matrix_(DOMFloat32Array::Create(16)) { projection_matrix_(DOMFloat32Array::Create(16)) {
......
...@@ -21,12 +21,12 @@ class XRView final : public ScriptWrappable { ...@@ -21,12 +21,12 @@ class XRView final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
public: public:
enum Eye { kEyeLeft = 0, kEyeRight = 1 }; enum XREye { kEyeLeft = 0, kEyeRight = 1 };
XRView(XRSession*, Eye); XRView(XRSession*, XREye);
const String& eye() const { return eye_string_; } const String& eye() const { return eye_string_; }
Eye EyeValue() const { return eye_; } XREye EyeValue() const { return eye_; }
XRSession* session() const; XRSession* session() const;
DOMFloat32Array* projectionMatrix() const { return projection_matrix_; } DOMFloat32Array* projectionMatrix() const { return projection_matrix_; }
...@@ -60,7 +60,7 @@ class XRView final : public ScriptWrappable { ...@@ -60,7 +60,7 @@ class XRView final : public ScriptWrappable {
void Trace(blink::Visitor*) override; void Trace(blink::Visitor*) override;
private: private:
const Eye eye_; const XREye eye_;
String eye_string_; String eye_string_;
Member<XRSession> session_; Member<XRSession> session_;
Member<DOMFloat32Array> projection_matrix_; Member<DOMFloat32Array> projection_matrix_;
......
...@@ -3,11 +3,16 @@ ...@@ -3,11 +3,16 @@
// found in the LICENSE file. // found in the LICENSE file.
// https://immersive-web.github.io/webxr/#xrview-interface // https://immersive-web.github.io/webxr/#xrview-interface
enum XREye {
"left",
"right"
};
[ [
SecureContext, SecureContext,
Exposed=Window, Exposed=Window,
OriginTrialEnabled=WebXR OriginTrialEnabled=WebXR
] interface XRView { ] interface XRView {
readonly attribute VREye? eye; readonly attribute XREye eye;
readonly attribute Float32Array projectionMatrix; readonly attribute Float32Array projectionMatrix;
}; };
...@@ -157,7 +157,7 @@ XRViewport* XRWebGLLayer::getViewport(XRView* view) { ...@@ -157,7 +157,7 @@ XRViewport* XRWebGLLayer::getViewport(XRView* view) {
return GetViewportForEye(view->EyeValue()); return GetViewportForEye(view->EyeValue());
} }
XRViewport* XRWebGLLayer::GetViewportForEye(XRView::Eye eye) { XRViewport* XRWebGLLayer::GetViewportForEye(XRView::XREye eye) {
if (viewports_dirty_) if (viewports_dirty_)
UpdateViewports(); UpdateViewports();
......
...@@ -62,7 +62,7 @@ class XRWebGLLayer final : public XRLayer, ...@@ -62,7 +62,7 @@ class XRWebGLLayer final : public XRLayer,
static double getNativeFramebufferScaleFactor(XRSession* session); static double getNativeFramebufferScaleFactor(XRSession* session);
XRViewport* GetViewportForEye(XRView::Eye); XRViewport* GetViewportForEye(XRView::XREye);
void UpdateViewports(); void UpdateViewports();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment