| 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 22 matching lines...) Expand all Loading... |
| 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 "wtf/HashCountedSet.h" | 36 #include "wtf/HashCountedSet.h" |
| 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 WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 class RenderObject; |
| 44 class Element; |
| 45 |
| 46 bool isRunningAnimation(const RenderObject&, CSSPropertyID = CSSPropertyInvalid)
; |
| 47 bool isRunningCompositorAnimation(const RenderObject&, CSSPropertyID = CSSProper
tyInvalid); |
| 48 bool isRunningCompositorAnimationCandidate(const RenderObject&, bool inCompositi
ngMode); |
| 49 |
| 43 class ActiveAnimations { | 50 class ActiveAnimations { |
| 44 public: | 51 public: |
| 45 // Animations that are currently active for this element, their effects will
be applied | 52 // Animations that are currently active for this element, their effects will
be applied |
| 46 // during a style recalc. CSS Transitions are included in this stack. | 53 // during a style recalc. CSS Transitions are included in this stack. |
| 47 AnimationStack& defaultStack() { return m_defaultStack; } | 54 AnimationStack& defaultStack() { return m_defaultStack; } |
| 48 // Tracks the state of active CSS Animations and Transitions. The individual
animations | 55 // Tracks the state of active CSS Animations and Transitions. The individual
animations |
| 49 // will also be part of the default stack, but the mapping betwen animation
name and | 56 // will also be part of the default stack, but the mapping betwen animation
name and |
| 50 // player is kept here. | 57 // player is kept here. |
| 51 CSSAnimations& cssAnimations() { return m_cssAnimations; } | 58 CSSAnimations& cssAnimations() { return m_cssAnimations; } |
| 52 | 59 |
| 53 typedef HashCountedSet<Player*> PlayerSet; | 60 typedef HashCountedSet<Player*> PlayerSet; |
| 54 // Players which have animations targeting this element. | 61 // Players which have animations targeting this element. |
| 55 const PlayerSet& players() const { return m_players; } | 62 const PlayerSet& players() const { return m_players; } |
| 56 PlayerSet& players() { return m_players; } | 63 PlayerSet& players() { return m_players; } |
| 57 | 64 |
| 58 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is
Empty(); } | 65 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is
Empty(); } |
| 66 |
| 67 bool hasCandidateForCompositorAnimation() const; |
| 68 bool isRunningAnimation(CSSPropertyID) const; |
| 69 bool isRunningCompositorAnimation(const Element*, CSSPropertyID) const; |
| 70 void cancelCompositorAnimations(); |
| 71 |
| 59 private: | 72 private: |
| 60 AnimationStack m_defaultStack; | 73 AnimationStack m_defaultStack; |
| 61 CSSAnimations m_cssAnimations; | 74 CSSAnimations m_cssAnimations; |
| 62 PlayerSet m_players; | 75 PlayerSet m_players; |
| 63 }; | 76 }; |
| 64 | 77 |
| 65 } // namespace WebCore | 78 } // namespace WebCore |
| 66 | 79 |
| 67 #endif | 80 #endif |
| OLD | NEW |