Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: third_party/WebKit/Source/core/animation/KeyframeEffect.h

Issue 2379863003: Implement AnimationEffectTimingReadOnly interface (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef KeyframeEffect_h 31 #ifndef KeyframeEffect_h
32 #define KeyframeEffect_h 32 #define KeyframeEffect_h
33 33
34 #include "core/CoreExport.h" 34 #include "core/CoreExport.h"
35 #include "core/animation/AnimationEffectTiming.h"
35 #include "core/animation/EffectInput.h" 36 #include "core/animation/EffectInput.h"
36 #include "core/animation/EffectModel.h" 37 #include "core/animation/EffectModel.h"
37 #include "core/animation/KeyframeEffectReadOnly.h" 38 #include "core/animation/KeyframeEffectReadOnly.h"
38 #include "core/animation/TimingInput.h" 39 #include "core/animation/TimingInput.h"
39 #include "platform/heap/Handle.h" 40 #include "platform/heap/Handle.h"
40 #include "wtf/RefPtr.h" 41 #include "wtf/RefPtr.h"
41 42
42 namespace blink { 43 namespace blink {
43 44
44 class KeyframeEffectOptions;
45 class Dictionary; 45 class Dictionary;
46 class Element; 46 class Element;
47 class ExceptionState; 47 class ExceptionState;
48 class KeyframeEffectOptions;
48 class PropertyHandle; 49 class PropertyHandle;
49 class SampledEffect; 50 class SampledEffect;
50 51
51 // Represents the effect of an Animation on an Element's properties. 52 // Represents the effect of an Animation on an Element's properties.
52 // http://w3c.github.io/web-animations/#keyframe-effect 53 // http://w3c.github.io/web-animations/#keyframe-effect
53 class CORE_EXPORT KeyframeEffect final : public KeyframeEffectReadOnly { 54 class CORE_EXPORT KeyframeEffect final : public KeyframeEffectReadOnly {
54 DEFINE_WRAPPERTYPEINFO(); 55 DEFINE_WRAPPERTYPEINFO();
55 public: 56 public:
56 enum Priority { DefaultPriority, TransitionPriority }; 57 enum Priority { DefaultPriority, TransitionPriority };
57 58
(...skipping 23 matching lines...) Expand all
81 bool hasActiveAnimationsOnCompositor(CSSPropertyID) const; 82 bool hasActiveAnimationsOnCompositor(CSSPropertyID) const;
82 bool cancelAnimationOnCompositor(); 83 bool cancelAnimationOnCompositor();
83 void restartAnimationOnCompositor(); 84 void restartAnimationOnCompositor();
84 void cancelIncompatibleAnimationsOnCompositor(); 85 void cancelIncompatibleAnimationsOnCompositor();
85 void pauseAnimationForTestingOnCompositor(double pauseTime); 86 void pauseAnimationForTestingOnCompositor(double pauseTime);
86 87
87 void attachCompositedLayers(); 88 void attachCompositedLayers();
88 89
89 void setCompositorAnimationIdsForTesting(const Vector<int>& compositorAnimat ionIds) { m_compositorAnimationIds = compositorAnimationIds; } 90 void setCompositorAnimationIdsForTesting(const Vector<int>& compositorAnimat ionIds) { m_compositorAnimationIds = compositorAnimationIds; }
90 91
92 AnimationEffectTiming* timing() override;
93
91 DECLARE_VIRTUAL_TRACE(); 94 DECLARE_VIRTUAL_TRACE();
92 95
93 void downgradeToNormal() { m_priority = DefaultPriority; } 96 void downgradeToNormal() { m_priority = DefaultPriority; }
94 97
95 protected: 98 protected:
96 void applyEffects(); 99 void applyEffects();
97 void clearEffects(); 100 void clearEffects();
98 void updateChildrenAndEffects() const override; 101 void updateChildrenAndEffects() const override;
99 void attach(Animation*) override; 102 void attach(Animation*) override;
100 void detach() override; 103 void detach() override;
101 void specifiedTimingChanged() override; 104 void specifiedTimingChanged() override;
102 double calculateTimeToEffectChange(bool forwards, double inheritedTime, doub le timeToNextIteration) const override; 105 double calculateTimeToEffectChange(bool forwards, double inheritedTime, doub le timeToNextIteration) const override;
103 virtual bool hasIncompatibleStyle(); 106 virtual bool hasIncompatibleStyle();
104 bool hasMultipleTransformProperties() const; 107 bool hasMultipleTransformProperties() const;
105 108
106 private: 109 private:
107 KeyframeEffect(Element*, EffectModel*, const Timing&, Priority, EventDelegat e*); 110 KeyframeEffect(Element*, EffectModel*, const Timing&, Priority, EventDelegat e*);
108 111
109 Priority m_priority; 112 Priority m_priority;
110 Vector<int> m_compositorAnimationIds; 113 Vector<int> m_compositorAnimationIds;
111 114
112 friend class AnimationAnimationV8Test; 115 friend class AnimationAnimationV8Test;
113 }; 116 };
114 117
115 DEFINE_TYPE_CASTS(KeyframeEffect, AnimationEffectReadOnly, animationNode, animat ionNode->isKeyframeEffect(), animationNode.isKeyframeEffect()); 118 DEFINE_TYPE_CASTS(KeyframeEffect, AnimationEffectReadOnly, animationNode, animat ionNode->isKeyframeEffect(), animationNode.isKeyframeEffect());
116 119
117 } // namespace blink 120 } // namespace blink
118 121
119 #endif // KeyframeEffect_h 122 #endif // KeyframeEffect_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698