summaryrefslogtreecommitdiffstats
path: root/cc/animation/animation.cc
diff options
context:
space:
mode:
authorajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-04 20:33:40 +0000
committerajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-04 20:33:40 +0000
commit57c0e87ac3474f48bbd4f6b6311054ad85899f4c (patch)
treeda4c2d562d132d0190d175de8b2688766ea602a9 /cc/animation/animation.cc
parent6669c8926e57adefcc1458e53dab1780b6831efa (diff)
downloadchromium_src-57c0e87ac3474f48bbd4f6b6311054ad85899f4c.zip
chromium_src-57c0e87ac3474f48bbd4f6b6311054ad85899f4c.tar.gz
chromium_src-57c0e87ac3474f48bbd4f6b6311054ad85899f4c.tar.bz2
Take time_offset into account when ticking animations that are Starting
LayerAnimationController::TickAnimations ignores the time_offset for animations that are Starting and for animations waiting for a synchronized start time. This CL makes Animation::TrimTimeToCurrentIteration handle computing the trimmed time for such animations, removing the need for TickAnimations to have special cases for computing trimmed time. BUG=284590 Review URL: https://chromiumcodereview.appspot.com/23926003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221257 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/animation/animation.cc')
-rw-r--r--cc/animation/animation.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/cc/animation/animation.cc b/cc/animation/animation.cc
index 214b8bfc..b509cfd 100644
--- a/cc/animation/animation.cc
+++ b/cc/animation/animation.cc
@@ -167,6 +167,12 @@ double Animation::TrimTimeToCurrentIteration(double monotonic_time) const {
// subtract all time spent paused.
trimmed -= start_time_ + total_paused_time_;
+ // If we're just starting or we're waiting on receiving a start time,
+ // time is 'stuck' at the initial state.
+ if ((run_state_ == Starting && !has_set_start_time()) ||
+ needs_synchronized_start_time())
+ trimmed = time_offset_;
+
// Zero is always the start of the animation.
if (trimmed <= 0)
return 0;