| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/vr/VRDisplay.h" | 5 #include "modules/vr/VRDisplay.h" |
| 6 | 6 |
| 7 #include "core/css/StylePropertySet.h" | 7 #include "core/css/StylePropertySet.h" |
| 8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
| 9 #include "core/dom/DocumentUserGestureToken.h" | 9 #include "core/dom/DocumentUserGestureToken.h" |
| 10 #include "core/dom/FrameRequestCallback.h" | 10 #include "core/dom/FrameRequestCallback.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 72 } |
| 73 | 73 |
| 74 Member<VRDisplay> m_vrDisplay; | 74 Member<VRDisplay> m_vrDisplay; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace | 77 } // namespace |
| 78 | 78 |
| 79 VRDisplay::VRDisplay(NavigatorVR* navigatorVR, | 79 VRDisplay::VRDisplay(NavigatorVR* navigatorVR, |
| 80 device::mojom::blink::VRDisplayPtr display, | 80 device::mojom::blink::VRDisplayPtr display, |
| 81 device::mojom::blink::VRDisplayClientRequest request) | 81 device::mojom::blink::VRDisplayClientRequest request) |
| 82 : ActiveScriptWrappable(this), | 82 : ContextLifecycleObserver(navigatorVR->document()), |
| 83 ContextLifecycleObserver(navigatorVR->document()), | |
| 84 m_navigatorVR(navigatorVR), | 83 m_navigatorVR(navigatorVR), |
| 85 m_isConnected(false), | 84 m_isConnected(false), |
| 86 m_isPresenting(false), | 85 m_isPresenting(false), |
| 87 m_isValidDeviceForPresenting(true), | 86 m_isValidDeviceForPresenting(true), |
| 88 m_canUpdateFramePose(true), | 87 m_canUpdateFramePose(true), |
| 89 m_capabilities(new VRDisplayCapabilities()), | 88 m_capabilities(new VRDisplayCapabilities()), |
| 90 m_eyeParametersLeft(new VREyeParameters()), | 89 m_eyeParametersLeft(new VREyeParameters()), |
| 91 m_eyeParametersRight(new VREyeParameters()), | 90 m_eyeParametersRight(new VREyeParameters()), |
| 92 m_depthNear(0.01), | 91 m_depthNear(0.01), |
| 93 m_depthFar(10000.0), | 92 m_depthFar(10000.0), |
| 94 m_fullscreenCheckTimer(this, &VRDisplay::onFullscreenCheck), | 93 m_fullscreenCheckTimer(this, &VRDisplay::onFullscreenCheck), |
| 95 m_contextGL(nullptr), | 94 m_contextGL(nullptr), |
| 96 m_animationCallbackRequested(false), | 95 m_animationCallbackRequested(false), |
| 97 m_inAnimationFrame(false), | 96 m_inAnimationFrame(false), |
| 98 m_display(std::move(display)), | 97 m_display(std::move(display)), |
| 99 m_binding(this, std::move(request)) { | 98 m_binding(this, std::move(request)) {} |
| 100 } | |
| 101 | 99 |
| 102 VRDisplay::~VRDisplay() {} | 100 VRDisplay::~VRDisplay() {} |
| 103 | 101 |
| 104 VRController* VRDisplay::controller() { | 102 VRController* VRDisplay::controller() { |
| 105 return m_navigatorVR->controller(); | 103 return m_navigatorVR->controller(); |
| 106 } | 104 } |
| 107 | 105 |
| 108 void VRDisplay::update(const device::mojom::blink::VRDisplayInfoPtr& display) { | 106 void VRDisplay::update(const device::mojom::blink::VRDisplayInfoPtr& display) { |
| 109 m_displayId = display->index; | 107 m_displayId = display->index; |
| 110 m_displayName = display->displayName; | 108 m_displayName = display->displayName; |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 visitor->trace(m_stageParameters); | 766 visitor->trace(m_stageParameters); |
| 769 visitor->trace(m_eyeParametersLeft); | 767 visitor->trace(m_eyeParametersLeft); |
| 770 visitor->trace(m_eyeParametersRight); | 768 visitor->trace(m_eyeParametersRight); |
| 771 visitor->trace(m_layer); | 769 visitor->trace(m_layer); |
| 772 visitor->trace(m_renderingContext); | 770 visitor->trace(m_renderingContext); |
| 773 visitor->trace(m_scriptedAnimationController); | 771 visitor->trace(m_scriptedAnimationController); |
| 774 visitor->trace(m_pendingPresentResolvers); | 772 visitor->trace(m_pendingPresentResolvers); |
| 775 } | 773 } |
| 776 | 774 |
| 777 } // namespace blink | 775 } // namespace blink |
| OLD | NEW |