| 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/dom/DOMException.h" | 7 #include "core/dom/DOMException.h" |
| 8 #include "core/dom/FrameRequestCallback.h" | 8 #include "core/dom/FrameRequestCallback.h" |
| 9 #include "core/dom/Fullscreen.h" | 9 #include "core/dom/Fullscreen.h" |
| 10 #include "core/dom/ScriptedAnimationController.h" | 10 #include "core/dom/ScriptedAnimationController.h" |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 controller()->submitFrame(m_displayId, m_framePose.Clone()); | 471 controller()->submitFrame(m_displayId, m_framePose.Clone()); |
| 472 m_canUpdateFramePose = true; | 472 m_canUpdateFramePose = true; |
| 473 } | 473 } |
| 474 | 474 |
| 475 void VRDisplay::onFullscreenCheck(TimerBase*) { | 475 void VRDisplay::onFullscreenCheck(TimerBase*) { |
| 476 // TODO: This is a temporary measure to track if fullscreen mode has been | 476 // TODO: This is a temporary measure to track if fullscreen mode has been |
| 477 // exited by the UA. If so we need to end VR presentation. Soon we won't | 477 // exited by the UA. If so we need to end VR presentation. Soon we won't |
| 478 // depend on the Fullscreen API to fake VR presentation, so this will | 478 // depend on the Fullscreen API to fake VR presentation, so this will |
| 479 // become unnessecary. Until that point, though, this seems preferable to | 479 // become unnessecary. Until that point, though, this seems preferable to |
| 480 // adding a bunch of notification plumbing to Fullscreen. | 480 // adding a bunch of notification plumbing to Fullscreen. |
| 481 if (!Fullscreen::isCurrentFullScreenElement(*m_layer.source())) { | 481 if (!Fullscreen::isFullscreenElement(*m_layer.source())) { |
| 482 m_isPresenting = false; | 482 m_isPresenting = false; |
| 483 m_navigatorVR->fireVRDisplayPresentChange(this); | 483 m_navigatorVR->fireVRDisplayPresentChange(this); |
| 484 m_fullscreenCheckTimer.stop(); | 484 m_fullscreenCheckTimer.stop(); |
| 485 controller()->exitPresent(m_displayId); | 485 controller()->exitPresent(m_displayId); |
| 486 } | 486 } |
| 487 } | 487 } |
| 488 | 488 |
| 489 ScriptedAnimationController& VRDisplay::ensureScriptedAnimationController( | 489 ScriptedAnimationController& VRDisplay::ensureScriptedAnimationController( |
| 490 Document* doc) { | 490 Document* doc) { |
| 491 if (!m_scriptedAnimationController) | 491 if (!m_scriptedAnimationController) |
| 492 m_scriptedAnimationController = ScriptedAnimationController::create(doc); | 492 m_scriptedAnimationController = ScriptedAnimationController::create(doc); |
| 493 | 493 |
| 494 return *m_scriptedAnimationController; | 494 return *m_scriptedAnimationController; |
| 495 } | 495 } |
| 496 | 496 |
| 497 DEFINE_TRACE(VRDisplay) { | 497 DEFINE_TRACE(VRDisplay) { |
| 498 visitor->trace(m_navigatorVR); | 498 visitor->trace(m_navigatorVR); |
| 499 visitor->trace(m_capabilities); | 499 visitor->trace(m_capabilities); |
| 500 visitor->trace(m_stageParameters); | 500 visitor->trace(m_stageParameters); |
| 501 visitor->trace(m_eyeParametersLeft); | 501 visitor->trace(m_eyeParametersLeft); |
| 502 visitor->trace(m_eyeParametersRight); | 502 visitor->trace(m_eyeParametersRight); |
| 503 visitor->trace(m_layer); | 503 visitor->trace(m_layer); |
| 504 visitor->trace(m_renderingContext); | 504 visitor->trace(m_renderingContext); |
| 505 visitor->trace(m_scriptedAnimationController); | 505 visitor->trace(m_scriptedAnimationController); |
| 506 } | 506 } |
| 507 | 507 |
| 508 } // namespace blink | 508 } // namespace blink |
| OLD | NEW |