Chromium Code Reviews| Index: third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| index 1480df6785b9b4e392e0ccdfd209e937ac9dddc1..976cc673159120eb4747b3b7e7d9ae0cc84eeec7 100644 |
| --- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| @@ -69,6 +69,7 @@ VRDisplay::VRDisplay(NavigatorVR* navigatorVR) |
| m_depthNear(0.01), |
| m_depthFar(10000.0), |
| m_fullscreenCheckTimer(this, &VRDisplay::onFullscreenCheck), |
| + m_contextGL(nullptr), |
| m_animationCallbackRequested(false), |
| m_inAnimationFrame(false) {} |
| @@ -174,6 +175,22 @@ void VRDisplay::cancelAnimationFrame(int id) { |
| m_scriptedAnimationController->cancelCallback(id); |
| } |
| +void VRDisplay::pausePresent() { |
| + Document* doc = m_navigatorVR->document(); |
| + if (!doc) |
| + return; |
| + doc->suspendScheduledTasks(); |
| + m_scriptedAnimationController->suspend(); |
|
bajones
2016/11/01 18:11:31
This would be the perfect place to fire the "vrdis
mthiesse
2016/11/02 14:39:02
Done.
|
| +} |
| + |
| +void VRDisplay::resumePresent() { |
| + Document* doc = m_navigatorVR->document(); |
| + if (!doc) |
| + return; |
| + m_scriptedAnimationController->resume(); |
| + doc->resumeScheduledTasks(); |
|
bajones
2016/11/01 18:11:31
Likewise, let's fire "vrdisplayfocus" here.
mthiesse
2016/11/02 14:39:02
Done.
|
| +} |
| + |
| void VRDisplay::serviceScriptedAnimations(double monotonicAnimationStartTime) { |
| if (!m_scriptedAnimationController) |
| return; |