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

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

Issue 667633003: Web Animations: Compositor timeOffset should not be scaled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: isinf -> std::isinf 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 | « ManualTests/animation/compositor-change-playback-rate.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimationPlayer.cpp
diff --git a/Source/core/animation/AnimationPlayer.cpp b/Source/core/animation/AnimationPlayer.cpp
index 845196504cbe0d5a44a08551d60d23e52dfe8074..470e4c5a43aaa92268b9033c6ca245d6b993a901 100644
--- a/Source/core/animation/AnimationPlayer.cpp
+++ b/Source/core/animation/AnimationPlayer.cpp
@@ -37,6 +37,7 @@
#include "core/events/AnimationPlayerEvent.h"
#include "core/frame/UseCounter.h"
#include "platform/TraceEvent.h"
+#include "wtf/MathExtras.h"
namespace blink {
@@ -597,7 +598,7 @@ void AnimationPlayer::setOutdated()
bool AnimationPlayer::canStartAnimationOnCompositor()
{
- if (m_playbackRate == 0)
+ if (m_playbackRate == 0 || (std::isinf(sourceEnd()) && m_playbackRate < 0))
return false;
return m_timeline && m_content && m_content->isAnimation() && playing();
@@ -612,6 +613,7 @@ bool AnimationPlayer::maybeStartAnimationOnCompositor()
double timeOffset = 0;
if (std::isnan(startTime)) {
timeOffset = m_playbackRate < 0 ? sourceEnd() - currentTimeInternal() : currentTimeInternal();
+ timeOffset = timeOffset / fabs(m_playbackRate);
}
return toAnimation(m_content.get())->maybeStartAnimationOnCompositor(startTime, timeOffset, m_playbackRate);
}
« no previous file with comments | « ManualTests/animation/compositor-change-playback-rate.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698