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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 class Element; | 46 class Element; |
47 class ExceptionState; | 47 class ExceptionState; |
48 class PropertyHandle; | 48 class PropertyHandle; |
49 class SampledEffect; | 49 class SampledEffect; |
50 | 50 |
51 class CORE_EXPORT Animation final : public AnimationNode { | 51 class CORE_EXPORT Animation final : public AnimationNode { |
52 DEFINE_WRAPPERTYPEINFO(); | 52 DEFINE_WRAPPERTYPEINFO(); |
53 public: | 53 public: |
54 enum Priority { DefaultPriority, TransitionPriority }; | 54 enum Priority { DefaultPriority, TransitionPriority }; |
55 | 55 |
56 static PassRefPtrWillBeRawPtr<Animation> create(Element*, PassRefPtrWillBeRa wPtr<AnimationEffect>, const Timing&, Priority = DefaultPriority, PassOwnPtrWill BeRawPtr<EventDelegate> = nullptr); | 56 static Animation* create(Element*, AnimationEffect*, const Timing&, Priority = DefaultPriority, EventDelegate* = nullptr); |
57 // Web Animations API Bindings constructors. | 57 // Web Animations API Bindings constructors. |
58 static PassRefPtrWillBeRawPtr<Animation> create(Element*, const Vector<Dicti onary>& keyframeDictionaryVector, double duration, ExceptionState&); | 58 static Animation* create(Element*, const Vector<Dictionary>& keyframeDiction aryVector, double duration, ExceptionState&); |
59 static PassRefPtrWillBeRawPtr<Animation> create(Element*, const Vector<Dicti onary>& keyframeDictionaryVector, const AnimationTimingProperties& timingInput, ExceptionState&); | 59 static Animation* create(Element*, const Vector<Dictionary>& keyframeDiction aryVector, const AnimationTimingProperties& timingInput, ExceptionState&); |
60 static PassRefPtrWillBeRawPtr<Animation> create(Element*, const Vector<Dicti onary>& keyframeDictionaryVector, ExceptionState&); | 60 static Animation* create(Element*, const Vector<Dictionary>& keyframeDiction aryVector, ExceptionState&); |
61 | 61 |
62 virtual ~Animation(); | 62 virtual ~Animation(); |
63 | 63 |
64 virtual bool isAnimation() const override { return true; } | 64 virtual bool isAnimation() const override { return true; } |
65 | 65 |
66 bool affects(PropertyHandle) const; | 66 bool affects(PropertyHandle) 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 void setEffect(PassRefPtrWillBeRawPtr<AnimationEffect> effect) { m_effect = effect; } | 69 void setEffect(AnimationEffect* effect) { m_effect = effect; } |
70 Priority priority() const { return m_priority; } | 70 Priority priority() const { return m_priority; } |
71 Element* target() const { return m_target; } | 71 Element* target() const { return m_target; } |
72 | 72 |
73 #if !ENABLE(OILPAN) | |
74 void notifyElementDestroyed(); | |
haraken
2015/05/08 00:13:06
Given that we've not yet shipped oilpan for the No
peria
2015/05/08 02:21:20
Thank you for this notification.
I'll follow insid
| |
75 #endif | |
76 | |
77 bool isCandidateForAnimationOnCompositor(double playerPlaybackRate) const; | 73 bool isCandidateForAnimationOnCompositor(double playerPlaybackRate) const; |
78 // Must only be called once. | 74 // Must only be called once. |
79 bool maybeStartAnimationOnCompositor(int group, double startTime, double tim eOffset, double playerPlaybackRate); | 75 bool maybeStartAnimationOnCompositor(int group, double startTime, double tim eOffset, double playerPlaybackRate); |
80 bool hasActiveAnimationsOnCompositor() const; | 76 bool hasActiveAnimationsOnCompositor() const; |
81 bool hasActiveAnimationsOnCompositor(CSSPropertyID) const; | 77 bool hasActiveAnimationsOnCompositor(CSSPropertyID) const; |
82 bool cancelAnimationOnCompositor(); | 78 bool cancelAnimationOnCompositor(); |
83 void restartAnimationOnCompositor(); | 79 void restartAnimationOnCompositor(); |
84 void cancelIncompatibleAnimationsOnCompositor(); | 80 void cancelIncompatibleAnimationsOnCompositor(); |
85 void pauseAnimationForTestingOnCompositor(double pauseTime); | 81 void pauseAnimationForTestingOnCompositor(double pauseTime); |
86 | 82 |
87 bool canAttachCompositedLayers() const; | 83 bool canAttachCompositedLayers() const; |
88 void attachCompositedLayers(); | 84 void attachCompositedLayers(); |
89 | 85 |
90 void setCompositorAnimationIdsForTesting(const Vector<int>& compositorAnimat ionIds) { m_compositorAnimationIds = compositorAnimationIds; } | 86 void setCompositorAnimationIdsForTesting(const Vector<int>& compositorAnimat ionIds) { m_compositorAnimationIds = compositorAnimationIds; } |
91 | 87 |
92 DECLARE_VIRTUAL_TRACE(); | 88 DECLARE_VIRTUAL_TRACE(); |
93 | 89 |
94 void downgradeToNormalAnimation() { m_priority = DefaultPriority; } | 90 void downgradeToNormalAnimation() { m_priority = DefaultPriority; } |
95 | 91 |
96 protected: | 92 protected: |
97 void applyEffects(); | 93 void applyEffects(); |
98 void clearEffects(); | 94 void clearEffects(); |
99 virtual void updateChildrenAndEffects() const override; | 95 virtual void updateChildrenAndEffects() const override; |
100 virtual void attach(AnimationPlayer*) override; | 96 virtual void attach(AnimationPlayer*) override; |
101 virtual void detach() override; | 97 virtual void detach() override; |
102 virtual void specifiedTimingChanged() override; | 98 virtual void specifiedTimingChanged() override; |
103 virtual double calculateTimeToEffectChange(bool forwards, double inheritedTi me, double timeToNextIteration) const override; | 99 virtual double calculateTimeToEffectChange(bool forwards, double inheritedTi me, double timeToNextIteration) const override; |
104 | 100 |
105 private: | 101 private: |
106 Animation(Element*, PassRefPtrWillBeRawPtr<AnimationEffect>, const Timing&, Priority, PassOwnPtrWillBeRawPtr<EventDelegate>); | 102 Animation(Element*, AnimationEffect*, const Timing&, Priority, EventDelegate *); |
107 | 103 |
108 RawPtrWillBeMember<Element> m_target; | 104 RawPtrWillBeMember<Element> m_target; |
109 RefPtrWillBeMember<AnimationEffect> m_effect; | 105 Member<AnimationEffect> m_effect; |
110 RawPtrWillBeMember<SampledEffect> m_sampledEffect; | 106 Member<SampledEffect> m_sampledEffect; |
111 | 107 |
112 Priority m_priority; | 108 Priority m_priority; |
113 | 109 |
114 Vector<int> m_compositorAnimationIds; | 110 Vector<int> m_compositorAnimationIds; |
115 | 111 |
116 friend class AnimationAnimationV8Test; | 112 friend class AnimationAnimationV8Test; |
117 }; | 113 }; |
118 | 114 |
119 DEFINE_TYPE_CASTS(Animation, AnimationNode, animationNode, animationNode->isAnim ation(), animationNode.isAnimation()); | 115 DEFINE_TYPE_CASTS(Animation, AnimationNode, animationNode, animationNode->isAnim ation(), animationNode.isAnimation()); |
120 | 116 |
121 } // namespace blink | 117 } // namespace blink |
122 | 118 |
123 #endif // Animation_h | 119 #endif // Animation_h |
OLD | NEW |