| 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 26 matching lines...) Expand all Loading... |
| 37 #include "wtf/HashMap.h" | 37 #include "wtf/HashMap.h" |
| 38 #include "wtf/RefPtr.h" | 38 #include "wtf/RefPtr.h" |
| 39 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class CSSAnimations; | 43 class CSSAnimations; |
| 44 class RenderObject; | 44 class RenderObject; |
| 45 class Element; | 45 class Element; |
| 46 | 46 |
| 47 typedef WillBeHeapHashMap<RawPtrWillBeWeakMember<AnimationPlayer>, int> Animatio
nPlayerCountedSet; | 47 typedef WillBeHeapHashCountedSet<RawPtrWillBeWeakMember<AnimationPlayer> > Anima
tionPlayerCountedSet; |
| 48 | 48 |
| 49 class ActiveAnimations : public NoBaseWillBeGarbageCollectedFinalized<ActiveAnim
ations> { | 49 class ActiveAnimations : public NoBaseWillBeGarbageCollectedFinalized<ActiveAnim
ations> { |
| 50 WTF_MAKE_NONCOPYABLE(ActiveAnimations); | 50 WTF_MAKE_NONCOPYABLE(ActiveAnimations); |
| 51 public: | 51 public: |
| 52 ActiveAnimations() | 52 ActiveAnimations() |
| 53 : m_animationStyleChange(false) | 53 : m_animationStyleChange(false) |
| 54 { | 54 { |
| 55 } | 55 } |
| 56 | 56 |
| 57 ~ActiveAnimations(); | 57 ~ActiveAnimations(); |
| 58 | 58 |
| 59 // Animations that are currently active for this element, their effects will
be applied | 59 // Animations that are currently active for this element, their effects will
be applied |
| 60 // during a style recalc. CSS Transitions are included in this stack. | 60 // during a style recalc. CSS Transitions are included in this stack. |
| 61 AnimationStack& defaultStack() { return m_defaultStack; } | 61 AnimationStack& defaultStack() { return m_defaultStack; } |
| 62 const AnimationStack& defaultStack() const { return m_defaultStack; } | 62 const AnimationStack& defaultStack() const { return m_defaultStack; } |
| 63 // Tracks the state of active CSS Animations and Transitions. The individual
animations | 63 // Tracks the state of active CSS Animations and Transitions. The individual
animations |
| 64 // will also be part of the default stack, but the mapping betwen animation
name and | 64 // will also be part of the default stack, but the mapping betwen animation
name and |
| 65 // player is kept here. | 65 // player is kept here. |
| 66 CSSAnimations& cssAnimations() { return m_cssAnimations; } | 66 CSSAnimations& cssAnimations() { return m_cssAnimations; } |
| 67 const CSSAnimations& cssAnimations() const { return m_cssAnimations; } | 67 const CSSAnimations& cssAnimations() const { return m_cssAnimations; } |
| 68 | 68 |
| 69 // AnimationPlayers which have animations targeting this element. | 69 // AnimationPlayers which have animations targeting this element. |
| 70 const AnimationPlayerCountedSet& players() const { return m_players; } | 70 AnimationPlayerCountedSet& players() { return m_players; } |
| 71 void addPlayer(AnimationPlayer*); | |
| 72 void removePlayer(AnimationPlayer*); | |
| 73 | 71 |
| 74 #if ENABLE(OILPAN) | 72 #if ENABLE(OILPAN) |
| 75 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is
Empty(); } | 73 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is
Empty(); } |
| 76 #else | 74 #else |
| 77 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is
Empty() && m_animations.isEmpty(); } | 75 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is
Empty() && m_animations.isEmpty(); } |
| 78 #endif | 76 #endif |
| 79 | 77 |
| 80 void cancelAnimationOnCompositor(); | 78 void cancelAnimationOnCompositor(); |
| 81 | 79 |
| 82 void updateAnimationFlags(RenderStyle&); | 80 void updateAnimationFlags(RenderStyle&); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 103 Vector<Animation*> m_animations; | 101 Vector<Animation*> m_animations; |
| 104 #endif | 102 #endif |
| 105 | 103 |
| 106 // CSSAnimations checks if a style change is due to animation. | 104 // CSSAnimations checks if a style change is due to animation. |
| 107 friend class CSSAnimations; | 105 friend class CSSAnimations; |
| 108 }; | 106 }; |
| 109 | 107 |
| 110 } // namespace blink | 108 } // namespace blink |
| 111 | 109 |
| 112 #endif | 110 #endif |
| OLD | NEW |