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

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

Issue 172003002: Web Animations: Don't mark players as outdated upon currentTime access (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@currentplayers
Patch Set: Created 6 years, 10 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/Player.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/Player.cpp
diff --git a/Source/core/animation/Player.cpp b/Source/core/animation/Player.cpp
index 79e796d4d653cd810d9f12eaaca62afd0ae948b6..1e0a5aedbba992c430c8bb593be89633c9da587f 100644
--- a/Source/core/animation/Player.cpp
+++ b/Source/core/animation/Player.cpp
@@ -92,7 +92,7 @@ double Player::currentTimeWithLag() const
return std::isinf(time) ? time : time - m_storedTimeLag;
}
-void Player::updateTimingState(double newCurrentTime)
+void Player::updateTimingState(double newCurrentTime, bool shouldSetOutdated)
{
ASSERT(!isNull(newCurrentTime));
m_held = m_paused || !m_playbackRate || limited(newCurrentTime);
@@ -103,15 +103,16 @@ void Player::updateTimingState(double newCurrentTime)
m_holdTime = nullValue();
m_storedTimeLag = currentTimeWithoutLag() - newCurrentTime;
}
- setOutdated();
+ if (shouldSetOutdated)
dstockwell 2014/02/24 07:44:07 Shouldn't we be able to derive this from above? Ch
Timothy Loh 2014/03/04 03:13:07 Ok this ends up being a little more complicated be
+ setOutdated();
}
-void Player::updateCurrentTimingState()
+void Player::updateCurrentTimingState(bool shouldSetOutdated)
{
if (m_held) {
- updateTimingState(m_holdTime);
+ updateTimingState(m_holdTime, shouldSetOutdated);
} else {
- updateTimingState(currentTimeWithLag());
+ updateTimingState(currentTimeWithLag(), shouldSetOutdated);
if (m_held && limited(m_holdTime))
m_holdTime = m_playbackRate < 0 ? 0 : sourceEnd();
}
@@ -119,7 +120,7 @@ void Player::updateCurrentTimingState()
double Player::currentTime()
{
- updateCurrentTimingState();
+ updateCurrentTimingState(false);
if (m_held)
return m_holdTime;
return currentTimeWithLag();
@@ -261,15 +262,12 @@ void Player::cancelAnimationOnCompositor()
bool Player::update()
{
- if (!m_timeline)
- return false;
-
- double inheritedTime = isNull(m_timeline->currentTime()) ? nullValue() : currentTime();
m_outdated = false;
- if (!m_content)
+ if (!m_timeline || !m_content)
return false;
+ double inheritedTime = isNull(m_timeline->currentTime()) ? nullValue() : currentTime();
m_content->updateInheritedTime(inheritedTime);
ASSERT(!m_outdated);
« no previous file with comments | « Source/core/animation/Player.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698