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

Unified Diff: Source/core/animation/css/CSSAnimations.cpp

Issue 73643004: Web Animations: Extract an API for servicing animations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 1 month 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/css/CSSAnimations.h ('k') | Source/core/animation/css/CSSPendingAnimations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/css/CSSAnimations.cpp
diff --git a/Source/core/animation/css/CSSAnimations.cpp b/Source/core/animation/css/CSSAnimations.cpp
index c15d9f3fa79dfad7092c9783f2d8079750a87176..7ad6202dd48e6419642e8ff39937da906d0201b1 100644
--- a/Source/core/animation/css/CSSAnimations.cpp
+++ b/Source/core/animation/css/CSSAnimations.cpp
@@ -525,6 +525,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
Player* player = element->document().timeline()->createPlayer(animation.get());
player->setPaused(inertAnimation->paused());
element->document().cssPendingAnimations().add(player);
+ player->update();
players.add(player);
}
m_animations.set(iter->name, players);
@@ -547,6 +548,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
OwnPtr<TransitionEventDelegate> eventDelegate = adoptPtr(new TransitionEventDelegate(element, id));
RefPtr<Animation> transition = Animation::create(element, inertAnimation->effect(), inertAnimation->specified(), Animation::TransitionPriority, eventDelegate.release());
RefPtr<Player> player = element->document().transitionTimeline()->createPlayer(transition.get());
+ player->update();
element->document().cssPendingAnimations().add(player.get());
runningTransition.transition = transition.get();
m_transitions.set(id, runningTransition);
@@ -691,35 +693,6 @@ void CSSAnimations::calculateTransitionCompositableValues(CSSAnimationUpdate* up
update->adoptCompositableValuesForTransitions(compositableValuesForTransitions);
}
-bool CSSAnimations::shouldCompositeForPendingAnimations(bool renderViewInCompositingMode) const
-{
- if (!m_pendingUpdate)
- return false;
-
- for (size_t i = 0; i < m_pendingUpdate->newAnimations().size(); ++i) {
- HashSet<RefPtr<InertAnimation> > animations = m_pendingUpdate->newAnimations()[i].animations;
- for (HashSet<RefPtr<InertAnimation> >::const_iterator it = animations.begin(); it != animations.end(); ++it) {
- ASSERT((*it)->effect());
- AnimationEffect* effect = (*it)->effect();
- // FIXME: Perhaps pass a predicate function so that we can remove the explicit checks from this file?
- if ((effect->affects(CSSPropertyOpacity) && renderViewInCompositingMode)
- || effect->affects(CSSPropertyWebkitTransform)
- || effect->affects(CSSPropertyWebkitFilter))
- return true;
- }
- }
-
- for (size_t i = 0; i < m_pendingUpdate->newTransitions().size(); ++i) {
- AnimationEffect* effect = m_pendingUpdate->newTransitions()[i].animation->effect();
- if ((effect->affects(CSSPropertyOpacity) && renderViewInCompositingMode)
- || effect->affects(CSSPropertyWebkitTransform)
- || effect->affects(CSSPropertyWebkitFilter))
- return true;
- }
-
- return false;
-}
-
void CSSAnimations::AnimationEventDelegate::maybeDispatch(Document::ListenerType listenerType, const AtomicString& eventName, double elapsedTime)
{
if (m_target->document().hasListenerType(listenerType))
« no previous file with comments | « Source/core/animation/css/CSSAnimations.h ('k') | Source/core/animation/css/CSSPendingAnimations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698