Chromium Code Reviews| Index: cc/layer_animation_controller.cc |
| diff --git a/cc/layer_animation_controller.cc b/cc/layer_animation_controller.cc |
| index 0ec11e4fa5d06e49bc779cfbcbf9020ee6429920..d39873087c6b00ed0fddeec3860f988db1598905 100644 |
| --- a/cc/layer_animation_controller.cc |
| +++ b/cc/layer_animation_controller.cc |
| @@ -125,6 +125,25 @@ void LayerAnimationController::animate(double monotonicTime) |
| m_lastTickTime = monotonicTime; |
| } |
| +void LayerAnimationController::accumulatePropertyUpdates(double monotonicTime, |
| + AnimationEventsVector* events) |
| +{ |
| + if (!events) |
| + return; |
| + |
| + for (size_t i = 0; i < m_activeAnimations.size(); ++i) { |
| + if (m_activeAnimations[i]->targetProperty() == Animation::Opacity) { |
|
Ian Vollick
2013/03/06 01:00:57
Need to check that the animation is impl only here
wjmaclean
2013/03/06 17:03:13
Done.
|
| + Animation* animation = m_activeAnimations[i]; |
| + float opacity = animation->curve()->toFloatAnimationCurve()->getValue(monotonicTime); |
| + AnimationEvent event(AnimationEvent::PropertyUpdate, |
| + m_id, animation->group(), |
| + Animation::Opacity, monotonicTime, |
| + opacity); |
| + events->push_back(event); |
| + } |
| + } |
| +} |
| + |
| void LayerAnimationController::updateState(AnimationEventsVector* events) |
| { |
| if (!hasActiveObserver()) |
| @@ -136,6 +155,8 @@ void LayerAnimationController::updateState(AnimationEventsVector* events) |
| startAnimationsWaitingForTargetAvailability(m_lastTickTime); |
| promoteStartedAnimations(m_lastTickTime, events); |
| + accumulatePropertyUpdates(m_lastTickTime, events); |
| + |
| updateActivation(); |
| } |
| @@ -245,7 +266,10 @@ void LayerAnimationController::pushNewAnimationsToImplThread(LayerAnimationContr |
| struct IsCompleted { |
| IsCompleted(const LayerAnimationController& mainThreadController) : m_mainThreadController(mainThreadController) { } |
| - bool operator()(Animation* animation) const { return !m_mainThreadController.getAnimation(animation->group(), animation->targetProperty()); } |
| + bool operator()(Animation* animation) const { |
| + if (animation->isImplAnimationOnly()) |
| + return false; |
| + return !m_mainThreadController.getAnimation(animation->group(), animation->targetProperty()); } |
| private: |
| const LayerAnimationController& m_mainThreadController; |
| }; |