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

Side by Side Diff: Source/core/animation/Animation.cpp

Issue 15405006: Modify AnimationEffect::sample() to return a CompositableValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix rebase Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/animation/Animation.h ('k') | Source/core/animation/AnimationEffect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 if (m_isInTargetActiveAnimationsList) 53 if (m_isInTargetActiveAnimationsList)
54 m_target->removeActiveAnimation(this); 54 m_target->removeActiveAnimation(this);
55 } 55 }
56 56
57 void Animation::applyEffects(bool previouslyActiveOrInEffect) 57 void Animation::applyEffects(bool previouslyActiveOrInEffect)
58 { 58 {
59 if (!previouslyActiveOrInEffect) { 59 if (!previouslyActiveOrInEffect) {
60 m_target->addActiveAnimation(this); 60 m_target->addActiveAnimation(this);
61 m_isInTargetActiveAnimationsList = true; 61 m_isInTargetActiveAnimationsList = true;
62 } 62 }
63 m_cachedStyle = m_effect->sample(0, currentIteration()); 63 m_compositableValues = m_effect->sample(currentIteration(), 0.0);
64 m_target->setNeedsStyleRecalc(SyntheticStyleChange); 64 m_target->setNeedsStyleRecalc(SyntheticStyleChange);
65 } 65 }
66 66
67 void Animation::clearEffects() 67 void Animation::clearEffects()
68 { 68 {
69 m_target->removeActiveAnimation(this); 69 m_target->removeActiveAnimation(this);
70 m_isInTargetActiveAnimationsList = false; 70 m_isInTargetActiveAnimationsList = false;
71 m_cachedStyle.clear(); 71 m_compositableValues.clear();
72 } 72 }
73 73
74 void Animation::updateChildrenAndEffects(bool wasActiveOrInEffect) const 74 void Animation::updateChildrenAndEffects(bool wasActiveOrInEffect) const
75 { 75 {
76 const bool isActiveOrInEffect = isActive() || isInEffect(); 76 const bool isActiveOrInEffect = isActive() || isInEffect();
77 ASSERT(m_isInTargetActiveAnimationsList == wasActiveOrInEffect); 77 ASSERT(m_isInTargetActiveAnimationsList == wasActiveOrInEffect);
78 if (wasActiveOrInEffect && !isActiveOrInEffect) 78 if (wasActiveOrInEffect && !isActiveOrInEffect)
79 const_cast<Animation*>(this)->clearEffects(); 79 const_cast<Animation*>(this)->clearEffects();
80 else if (isActiveOrInEffect) 80 else if (isActiveOrInEffect)
81 const_cast<Animation*>(this)->applyEffects(wasActiveOrInEffect); 81 const_cast<Animation*>(this)->applyEffects(wasActiveOrInEffect);
82 } 82 }
83 83
84 } // namespace 84 } // namespace
OLDNEW
« no previous file with comments | « Source/core/animation/Animation.h ('k') | Source/core/animation/AnimationEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698