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

Unified Diff: Source/core/animation/CompositorPendingAnimations.cpp

Issue 638313002: Web Animations: Overhaul and trace play state in AnimationPlayer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't set compositor pending when paused for testing Created 6 years, 2 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 | « Source/core/animation/CompositorPendingAnimations.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/CompositorPendingAnimations.cpp
diff --git a/Source/core/animation/CompositorPendingAnimations.cpp b/Source/core/animation/CompositorPendingAnimations.cpp
index c4aa6897798e1e4f7f690e17e635cd1435dffdd9..134baeacd5abca7f0e3c824346e9b33804315aa8 100644
--- a/Source/core/animation/CompositorPendingAnimations.cpp
+++ b/Source/core/animation/CompositorPendingAnimations.cpp
@@ -114,24 +114,36 @@ bool CompositorPendingAnimations::update(bool startOnCompositor)
}
// If not, go ahead and start any animations that were waiting.
- notifyCompositorAnimationStarted(monotonicallyIncreasingTime());
+ notifyAnimationStarted(monotonicallyIncreasingTime(), false);
ASSERT(m_pending.isEmpty());
return false;
}
-void CompositorPendingAnimations::notifyCompositorAnimationStarted(double monotonicAnimationStartTime)
+void CompositorPendingAnimations::notifyAnimationStarted(double monotonicAnimationStartTime, bool startedOnCompositor)
{
+ TRACE_EVENT0("blink", "CompositorPendingAnimations::notifyCompositorAnimationStarted");
for (size_t i = 0; i < m_waitingForCompositorAnimationStart.size(); ++i) {
AnimationPlayer* player = m_waitingForCompositorAnimationStart[i].get();
if (player->hasStartTime())
continue;
- player->notifyCompositorStartTime(monotonicAnimationStartTime - player->timeline()->zeroTime());
+ double effectiveStartTime = monotonicAnimationStartTime - player->timeline()->zeroTime();
+ if (startedOnCompositor) {
+ player->notifyCompositorStartTime(effectiveStartTime);
+ } else {
+ player->notifyStartTime(effectiveStartTime);
+ }
}
m_waitingForCompositorAnimationStart.clear();
}
+void CompositorPendingAnimations::notifyCompositorAnimationStarted(double monotonicAnimationStartTime)
+{
+ TRACE_EVENT0("blink", "CompositorPendingAnimations::notifyCompositorAnimationStarted");
+ notifyAnimationStarted(monotonicAnimationStartTime, true);
+}
+
void CompositorPendingAnimations::trace(Visitor* visitor)
{
visitor->trace(m_pending);
« no previous file with comments | « Source/core/animation/CompositorPendingAnimations.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698