Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Unified Diff: third_party/WebKit/Source/modules/vr/VRDisplay.cpp

Issue 2471433002: Implement WebVR presentation pausing for VR Shell Menu Mode (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
« device/vr/vr_service.mojom ('K') | « third_party/WebKit/Source/modules/vr/VRDisplay.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698