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

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

Issue 2752343002: WebVR: move animation state check to deferred task (Closed)
Patch Set: Created 3 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c0d5c4e0c018a553eb3694d746b9969b90257c78..2fb51eb7a22bc52a12f9de73a174f70efa99d492 100644
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -690,10 +690,17 @@ void VRDisplay::OnDeactivate(
}
void VRDisplay::processScheduledAnimations(double timestamp) {
+ // Check if we still have a valid context, the animation controller
+ // or document may have disappeared since we scheduled this.
+ Document* doc = this->document();
+ if (!doc || m_displayBlurred || !m_scriptedAnimationController)
+ return;
+
TRACE_EVENT1("gpu", "VRDisplay::OnVSync", "frame", m_vrFrameId);
AutoReset<bool> animating(&m_inAnimationFrame, true);
m_pendingRaf = false;
+
m_scriptedAnimationController->serviceScriptedAnimations(timestamp);
}
@@ -708,9 +715,6 @@ void VRDisplay::OnVSync(device::mojom::blink::VRPosePtr pose,
return;
}
m_pendingVsync = false;
- Document* doc = this->document();
- if (!doc || m_displayBlurred || !m_scriptedAnimationController)
- return;
WTF::TimeDelta timeDelta =
WTF::TimeDelta::FromMicroseconds(time->microseconds);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698