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

Unified Diff: cc/layer_animation_controller.cc

Issue 12453010: Allow impl-only animations, and return opacity values via AnimationEvents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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;
};

Powered by Google App Engine
This is Rietveld 408576698