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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 bool affects(CSSPropertyID) const; | 66 bool affects(CSSPropertyID) const; |
67 const AnimationEffect* effect() const { return m_effect.get(); } | 67 const AnimationEffect* effect() const { return m_effect.get(); } |
68 AnimationEffect* effect() { return m_effect.get(); } | 68 AnimationEffect* effect() { return m_effect.get(); } |
69 Priority priority() const { return m_priority; } | 69 Priority priority() const { return m_priority; } |
70 Element* target() { return m_target; } | 70 Element* target() { return m_target; } |
71 | 71 |
72 void notifySampledEffectRemovedFromAnimationStack(); | 72 void notifySampledEffectRemovedFromAnimationStack(); |
73 void notifyElementDestroyed(); | 73 void notifyElementDestroyed(); |
74 | 74 |
75 bool isCandidateForAnimationOnCompositor() const; | |
76 // Must only be called once. | |
77 bool maybeStartAnimationOnCompositor(double startTime, double timeOffset); | |
78 bool hasActiveAnimationsOnCompositor() const; | |
79 bool hasActiveAnimationsOnCompositor(CSSPropertyID) const; | |
80 void cancelAnimationOnCompositor(); | |
81 void pauseAnimationForTestingOnCompositor(double pauseTime); | |
82 | |
83 protected: | 75 protected: |
84 void applyEffects(); | 76 void applyEffects(); |
85 void clearEffects(); | 77 void clearEffects(); |
86 virtual void updateChildrenAndEffects() const override; | 78 virtual void updateChildrenAndEffects() const override; |
87 virtual void attach(AnimationPlayer*) override; | 79 virtual void attach(AnimationPlayer*) override; |
88 virtual void detach() override; | 80 virtual void detach() override; |
89 virtual void specifiedTimingChanged() override; | 81 virtual void specifiedTimingChanged() override; |
90 virtual double calculateTimeToEffectChange(bool forwards, double inheritedTi
me, double timeToNextIteration) const override; | 82 virtual double calculateTimeToEffectChange(bool forwards, double inheritedTi
me, double timeToNextIteration) const override; |
91 | 83 |
92 private: | 84 private: |
93 Animation(Element*, PassRefPtr<AnimationEffect>, const Timing&, Priority, Pa
ssOwnPtr<EventDelegate>); | 85 Animation(Element*, PassRefPtr<AnimationEffect>, const Timing&, Priority, Pa
ssOwnPtr<EventDelegate>); |
94 | 86 |
95 RawPtr<Element> m_target; | 87 RawPtr<Element> m_target; |
96 RefPtr<AnimationEffect> m_effect; | 88 RefPtr<AnimationEffect> m_effect; |
97 RawPtr<SampledEffect> m_sampledEffect; | 89 RawPtr<SampledEffect> m_sampledEffect; |
98 | 90 |
99 Priority m_priority; | 91 Priority m_priority; |
100 | 92 |
101 Vector<int> m_compositorAnimationIds; | |
102 | |
103 friend class AnimationAnimationV8Test; | 93 friend class AnimationAnimationV8Test; |
104 }; | 94 }; |
105 | 95 |
106 DEFINE_TYPE_CASTS(Animation, AnimationNode, animationNode, animationNode->isAnim
ation(), animationNode.isAnimation()); | 96 DEFINE_TYPE_CASTS(Animation, AnimationNode, animationNode, animationNode->isAnim
ation(), animationNode.isAnimation()); |
107 | 97 |
108 } // namespace blink | 98 } // namespace blink |
109 | 99 |
110 #endif // SKY_ENGINE_CORE_ANIMATION_ANIMATION_H_ | 100 #endif // SKY_ENGINE_CORE_ANIMATION_ANIMATION_H_ |
OLD | NEW |