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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 class CSSAnimations; | 43 class CSSAnimations; |
44 class RenderObject; | 44 class RenderObject; |
45 class Element; | 45 class Element; |
46 | 46 |
47 typedef WillBeHeapHashCountedSet<RawPtrWillBeWeakMember<AnimationPlayer> > Anima
tionPlayerCountedSet; | 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) | |
54 { | |
55 } | |
56 | |
57 ~ActiveAnimations(); | 53 ~ActiveAnimations(); |
58 | 54 |
59 // Animations that are currently active for this element, their effects will
be applied | 55 // 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. | 56 // during a style recalc. CSS Transitions are included in this stack. |
61 AnimationStack& defaultStack() { return m_defaultStack; } | 57 AnimationStack& defaultStack() { return m_defaultStack; } |
62 const AnimationStack& defaultStack() const { return m_defaultStack; } | 58 const AnimationStack& defaultStack() const { return m_defaultStack; } |
63 // Tracks the state of active CSS Animations and Transitions. The individual
animations | 59 // 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 | 60 // will also be part of the default stack, but the mapping betwen animation
name and |
65 // player is kept here. | 61 // player is kept here. |
66 CSSAnimations& cssAnimations() { return m_cssAnimations; } | 62 CSSAnimations& cssAnimations() { return m_cssAnimations; } |
67 const CSSAnimations& cssAnimations() const { return m_cssAnimations; } | 63 const CSSAnimations& cssAnimations() const { return m_cssAnimations; } |
68 | 64 |
69 // AnimationPlayers which have animations targeting this element. | 65 // AnimationPlayers which have animations targeting this element. |
70 AnimationPlayerCountedSet& players() { return m_players; } | 66 AnimationPlayerCountedSet& players() { return m_players; } |
71 | 67 |
72 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is
Empty() && m_players.isEmpty(); } | 68 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is
Empty() && m_players.isEmpty(); } |
73 | 69 |
74 void cancelAnimationOnCompositor(); | 70 void cancelAnimationOnCompositor(); |
75 | 71 |
76 void updateAnimationFlags(RenderStyle&); | 72 void updateAnimationFlags(RenderStyle&); |
77 void setAnimationStyleChange(bool animationStyleChange) { m_animationStyleCh
ange = animationStyleChange; } | 73 void setAnimationStyleChange(bool animationStyleChange) { m_animationStyleCh
ange = animationStyleChange; } |
78 | 74 |
| 75 const RenderStyle* baseRenderStyle() const; |
| 76 void updateBaseRenderStyle(const RenderStyle*); |
| 77 |
79 #if !ENABLE(OILPAN) | 78 #if !ENABLE(OILPAN) |
80 void addAnimation(Animation* animation) { m_animations.append(animation); } | 79 void addAnimation(Animation* animation) { m_animations.append(animation); } |
81 void notifyAnimationDestroyed(Animation* animation) { m_animations.remove(m_
animations.find(animation)); } | 80 void notifyAnimationDestroyed(Animation* animation) { m_animations.remove(m_
animations.find(animation)); } |
82 #endif | 81 #endif |
83 | 82 |
84 void trace(Visitor*); | 83 void trace(Visitor*); |
85 | 84 |
86 private: | 85 private: |
87 bool isAnimationStyleChange() const { return m_animationStyleChange; } | 86 bool isAnimationStyleChange() const { return m_animationStyleChange; } |
88 | 87 |
89 AnimationStack m_defaultStack; | 88 AnimationStack m_defaultStack; |
90 CSSAnimations m_cssAnimations; | 89 CSSAnimations m_cssAnimations; |
91 AnimationPlayerCountedSet m_players; | 90 AnimationPlayerCountedSet m_players; |
92 bool m_animationStyleChange; | 91 bool m_animationStyleChange; |
| 92 RefPtr<RenderStyle> m_baseRenderStyle; |
93 | 93 |
94 #if !ENABLE(OILPAN) | 94 #if !ENABLE(OILPAN) |
95 // FIXME: Oilpan: This is to avoid a reference cycle that keeps Elements ali
ve | 95 // 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. | 96 // and won't be needed once the Node hierarchy becomes traceable. |
97 Vector<Animation*> m_animations; | 97 Vector<Animation*> m_animations; |
98 #endif | 98 #endif |
99 | 99 |
100 // CSSAnimations checks if a style change is due to animation. | 100 // CSSAnimations checks if a style change is due to animation. |
101 friend class CSSAnimations; | 101 friend class CSSAnimations; |
102 }; | 102 }; |
103 | 103 |
104 } // namespace blink | 104 } // namespace blink |
105 | 105 |
106 #endif | 106 #endif |
OLD | NEW |