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

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

Issue 1196023003: Web Animations: Avoid iteration when checking for outdated animations on timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/Animation.h ('k') | Source/core/animation/AnimationTimeline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/Animation.cpp
diff --git a/Source/core/animation/Animation.cpp b/Source/core/animation/Animation.cpp
index 3764803d35a13267bb6ef2e504f22da7b5a392cb..2e14410b09dc53ccc6b5973289cbcca4f49f146f 100644
--- a/Source/core/animation/Animation.cpp
+++ b/Source/core/animation/Animation.cpp
@@ -367,8 +367,7 @@ void Animation::notifyStartTime(double timelineTime)
// FIXME: This avoids marking this animation as outdated needlessly when a start time
// is notified, but we should refactor how outdating works to avoid this.
- m_outdated = false;
-
+ clearOutdated();
m_currentTimePending = false;
}
}
@@ -683,8 +682,19 @@ void Animation::setPlaybackRateInternal(double playbackRate)
setCurrentTimeInternal(storedCurrentTime, TimingUpdateOnDemand);
}
+void Animation::clearOutdated()
+{
+ if (!m_outdated)
+ return;
+ m_outdated = false;
+ if (m_timeline)
+ m_timeline->clearOutdatedAnimation(this);
+}
+
void Animation::setOutdated()
{
+ if (m_outdated)
+ return;
m_outdated = true;
if (m_timeline)
m_timeline->setOutdatedAnimation(this);
@@ -787,7 +797,7 @@ bool Animation::update(TimingUpdateReason reason)
PlayStateUpdateScope updateScope(*this, reason, DoNotSetCompositorPending);
- m_outdated = false;
+ clearOutdated();
bool idle = playStateInternal() == Idle;
if (m_content) {
« no previous file with comments | « Source/core/animation/Animation.h ('k') | Source/core/animation/AnimationTimeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698