Skip to content

Commit

Permalink
cc: Clean up tick times used for LayerAnimationControllerTests
Browse files Browse the repository at this point in the history
This makes LayerAnimationControllerTests no longer tick controllers
at time 0, since Animation::has_set_start_time returns false when
an animation's start time is 0.

To prevent future tests from running into this problem, this also
adds a DCHECK to LayerAnimationController::Animate.

BUG=None

Review URL: https://codereview.chromium.org/107223003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239319 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ajuma@chromium.org committed Dec 7, 2013
1 parent 73a4e78 commit 790ad32
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 115 deletions.
9 changes: 5 additions & 4 deletions cc/animation/layer_animation_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ void LayerAnimationController::PushAnimationUpdatesTo(
}

void LayerAnimationController::Animate(double monotonic_time) {
DCHECK(monotonic_time);
if (!HasValueObserver())
return;

Expand All @@ -143,6 +144,7 @@ void LayerAnimationController::AccumulatePropertyUpdates(
if (!animation->is_impl_only())
continue;

double trimmed = animation->TrimTimeToCurrentIteration(monotonic_time);
switch (animation->target_property()) {
case Animation::Opacity: {
AnimationEvent event(AnimationEvent::PropertyUpdate,
Expand All @@ -151,7 +153,7 @@ void LayerAnimationController::AccumulatePropertyUpdates(
Animation::Opacity,
monotonic_time);
event.opacity = animation->curve()->ToFloatAnimationCurve()->GetValue(
monotonic_time);
trimmed);
event.is_impl_only = true;
events->push_back(event);
break;
Expand All @@ -164,8 +166,7 @@ void LayerAnimationController::AccumulatePropertyUpdates(
Animation::Transform,
monotonic_time);
event.transform =
animation->curve()->ToTransformAnimationCurve()->GetValue(
monotonic_time);
animation->curve()->ToTransformAnimationCurve()->GetValue(trimmed);
event.is_impl_only = true;
events->push_back(event);
break;
Expand All @@ -178,7 +179,7 @@ void LayerAnimationController::AccumulatePropertyUpdates(
Animation::Filter,
monotonic_time);
event.filters = animation->curve()->ToFilterAnimationCurve()->GetValue(
monotonic_time);
trimmed);
event.is_impl_only = true;
events->push_back(event);
break;
Expand Down
Loading

0 comments on commit 790ad32

Please sign in to comment.