Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 15 matching lines...) Expand all Loading... | |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef ActiveAnimations_h | 31 #ifndef ActiveAnimations_h |
| 32 #define ActiveAnimations_h | 32 #define ActiveAnimations_h |
| 33 | 33 |
| 34 #include "core/animation/AnimationStack.h" | 34 #include "core/animation/AnimationStack.h" |
| 35 #include "core/animation/css/CSSAnimations.h" | 35 #include "core/animation/css/CSSAnimations.h" |
| 36 #include "core/rendering/style/RenderStyle.h" | |
| 36 #include "wtf/HashCountedSet.h" | 37 #include "wtf/HashCountedSet.h" |
| 37 #include "wtf/HashMap.h" | 38 #include "wtf/HashMap.h" |
| 38 #include "wtf/RefPtr.h" | 39 #include "wtf/RefPtr.h" |
| 39 #include "wtf/Vector.h" | 40 #include "wtf/Vector.h" |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 class CSSAnimations; | 44 class CSSAnimations; |
| 44 class RenderObject; | 45 class RenderObject; |
| 45 class Element; | 46 class Element; |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 68 | 69 |
| 69 // AnimationPlayers which have animations targeting this element. | 70 // AnimationPlayers which have animations targeting this element. |
| 70 AnimationPlayerCountedSet& players() { return m_players; } | 71 AnimationPlayerCountedSet& players() { return m_players; } |
| 71 | 72 |
| 72 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is Empty() && m_players.isEmpty(); } | 73 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is Empty() && m_players.isEmpty(); } |
| 73 | 74 |
| 74 void cancelAnimationOnCompositor(); | 75 void cancelAnimationOnCompositor(); |
| 75 | 76 |
| 76 void updateAnimationFlags(RenderStyle&); | 77 void updateAnimationFlags(RenderStyle&); |
| 77 void setAnimationStyleChange(bool animationStyleChange) { m_animationStyleCh ange = animationStyleChange; } | 78 void setAnimationStyleChange(bool animationStyleChange) { m_animationStyleCh ange = animationStyleChange; } |
| 79 bool isAnimationStyleChange() const { return m_animationStyleChange; } | |
| 80 | |
| 81 const RenderStyle* baseRenderStyle() const { return m_baseRenderStyle.get(); } | |
| 82 void setBaseRenderStyle(PassRefPtr<RenderStyle> renderStyle) | |
|
esprehn
2014/10/13 18:19:33
Can we make this out of line instead? Then we don'
rune
2014/10/13 21:31:48
Done.
| |
| 83 { | |
| 84 #if ENABLE(ASSERT) | |
| 85 if (m_baseRenderStyle && renderStyle) | |
| 86 ASSERT(*m_baseRenderStyle == *renderStyle); | |
| 87 #endif | |
| 88 m_baseRenderStyle = renderStyle; | |
| 89 } | |
| 78 | 90 |
| 79 #if !ENABLE(OILPAN) | 91 #if !ENABLE(OILPAN) |
| 80 void addAnimation(Animation* animation) { m_animations.append(animation); } | 92 void addAnimation(Animation* animation) { m_animations.append(animation); } |
| 81 void notifyAnimationDestroyed(Animation* animation) { m_animations.remove(m_ animations.find(animation)); } | 93 void notifyAnimationDestroyed(Animation* animation) { m_animations.remove(m_ animations.find(animation)); } |
| 82 #endif | 94 #endif |
| 83 | 95 |
| 84 void trace(Visitor*); | 96 void trace(Visitor*); |
| 85 | 97 |
| 86 private: | 98 private: |
| 87 bool isAnimationStyleChange() const { return m_animationStyleChange; } | |
| 88 | |
| 89 AnimationStack m_defaultStack; | 99 AnimationStack m_defaultStack; |
| 90 CSSAnimations m_cssAnimations; | 100 CSSAnimations m_cssAnimations; |
| 91 AnimationPlayerCountedSet m_players; | 101 AnimationPlayerCountedSet m_players; |
| 92 bool m_animationStyleChange; | 102 bool m_animationStyleChange; |
| 103 RefPtr<RenderStyle> m_baseRenderStyle; | |
| 93 | 104 |
| 94 #if !ENABLE(OILPAN) | 105 #if !ENABLE(OILPAN) |
| 95 // FIXME: Oilpan: This is to avoid a reference cycle that keeps Elements ali ve | 106 // FIXME: Oilpan: This is to avoid a reference cycle that keeps Elements ali ve |
| 96 // and won't be needed once the Node hierarchy becomes traceable. | 107 // and won't be needed once the Node hierarchy becomes traceable. |
| 97 Vector<Animation*> m_animations; | 108 Vector<Animation*> m_animations; |
| 98 #endif | 109 #endif |
| 99 | 110 |
| 100 // CSSAnimations checks if a style change is due to animation. | 111 // CSSAnimations checks if a style change is due to animation. |
| 101 friend class CSSAnimations; | 112 friend class CSSAnimations; |
| 102 }; | 113 }; |
| 103 | 114 |
| 104 } // namespace blink | 115 } // namespace blink |
| 105 | 116 |
| 106 #endif | 117 #endif |
| OLD | NEW |