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 @@
namespace blink {
XRView::XRView(XRSession* session, Eye eye)
XRView::XRView(XRSession* session, XREye eye)
: eye_(eye),
session_(session),
projection_matrix_(DOMFloat32Array::Create(16)) {
......
......@@ -21,12 +21,12 @@ class XRView final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
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_; }
Eye EyeValue() const { return eye_; }
XREye EyeValue() const { return eye_; }
XRSession* session() const;
DOMFloat32Array* projectionMatrix() const { return projection_matrix_; }
......@@ -60,7 +60,7 @@ class XRView final : public ScriptWrappable {
void Trace(blink::Visitor*) override;
private:
const Eye eye_;
const XREye eye_;
String eye_string_;
Member<XRSession> session_;
Member<DOMFloat32Array> projection_matrix_;
......
......@@ -3,11 +3,16 @@
// found in the LICENSE file.
// https://immersive-web.github.io/webxr/#xrview-interface
enum XREye {
"left",
"right"
};
[
SecureContext,
Exposed=Window,
OriginTrialEnabled=WebXR
] interface XRView {
readonly attribute VREye? eye;
readonly attribute XREye eye;
readonly attribute Float32Array projectionMatrix;
};
......@@ -157,7 +157,7 @@ XRViewport* XRWebGLLayer::getViewport(XRView* view) {
return GetViewportForEye(view->EyeValue());
}
XRViewport* XRWebGLLayer::GetViewportForEye(XRView::Eye eye) {
XRViewport* XRWebGLLayer::GetViewportForEye(XRView::XREye eye) {
if (viewports_dirty_)
UpdateViewports();
......
......@@ -62,7 +62,7 @@ class XRWebGLLayer final : public XRLayer,
static double getNativeFramebufferScaleFactor(XRSession* session);
XRViewport* GetViewportForEye(XRView::Eye);
XRViewport* GetViewportForEye(XRView::XREye);
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