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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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<KeyframeEffect> create(Element*, PassRefPtrWil
lBeRawPtr<EffectModel>, const Timing&, Priority = DefaultPriority, PassOwnPtrWil
lBeRawPtr<EventDelegate> = nullptr); | 56 static PassRefPtrWillBeRawPtr<KeyframeEffect> create(Element*, PassRefPtrWil
lBeRawPtr<EffectModel>, const Timing&, Priority = DefaultPriority, PassOwnPtrWil
lBeRawPtr<EventDelegate> = nullptr); |
57 // Web Animations API Bindings constructors. | 57 // Web Animations API Bindings constructors. |
58 static PassRefPtrWillBeRawPtr<KeyframeEffect> create(Element*, const Vector<
Dictionary>& keyframeDictionaryVector, double duration, ExceptionState&); | 58 static PassRefPtrWillBeRawPtr<KeyframeEffect> create(Element*, const Vector<
Dictionary>& keyframeDictionaryVector, double duration, ExceptionState&); |
59 static PassRefPtrWillBeRawPtr<KeyframeEffect> create(Element*, const Vector<
Dictionary>& keyframeDictionaryVector, const KeyframeEffectOptions& timingInput,
ExceptionState&); | 59 static PassRefPtrWillBeRawPtr<KeyframeEffect> create(Element*, const Vector<
Dictionary>& keyframeDictionaryVector, const KeyframeEffectOptions& timingInput,
ExceptionState&); |
60 static PassRefPtrWillBeRawPtr<KeyframeEffect> create(Element*, const Vector<
Dictionary>& keyframeDictionaryVector, ExceptionState&); | 60 static PassRefPtrWillBeRawPtr<KeyframeEffect> create(Element*, const Vector<
Dictionary>& keyframeDictionaryVector, ExceptionState&); |
61 | 61 |
62 virtual ~KeyframeEffect(); | 62 ~KeyframeEffect() override; |
63 | 63 |
64 virtual bool isAnimation() const override { return true; } | 64 bool isAnimation() const override { return true; } |
65 | 65 |
66 bool affects(PropertyHandle) const; | 66 bool affects(PropertyHandle) const; |
67 const EffectModel* model() const { return m_model.get(); } | 67 const EffectModel* model() const { return m_model.get(); } |
68 EffectModel* model() { return m_model.get(); } | 68 EffectModel* model() { return m_model.get(); } |
69 void setModel(PassRefPtrWillBeRawPtr<EffectModel> model) { m_model = model;
} | 69 void setModel(PassRefPtrWillBeRawPtr<EffectModel> model) { m_model = model;
} |
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) | 73 #if !ENABLE(OILPAN) |
74 void notifyElementDestroyed(); | 74 void notifyElementDestroyed(); |
(...skipping 14 matching lines...) Expand all Loading... |
89 | 89 |
90 void setCompositorAnimationIdsForTesting(const Vector<int>& compositorAnimat
ionIds) { m_compositorAnimationIds = compositorAnimationIds; } | 90 void setCompositorAnimationIdsForTesting(const Vector<int>& compositorAnimat
ionIds) { m_compositorAnimationIds = compositorAnimationIds; } |
91 | 91 |
92 DECLARE_VIRTUAL_TRACE(); | 92 DECLARE_VIRTUAL_TRACE(); |
93 | 93 |
94 void downgradeToNormal() { m_priority = DefaultPriority; } | 94 void downgradeToNormal() { m_priority = DefaultPriority; } |
95 | 95 |
96 protected: | 96 protected: |
97 void applyEffects(); | 97 void applyEffects(); |
98 void clearEffects(); | 98 void clearEffects(); |
99 virtual void updateChildrenAndEffects() const override; | 99 void updateChildrenAndEffects() const override; |
100 virtual void attach(Animation*) override; | 100 void attach(Animation*) override; |
101 virtual void detach() override; | 101 void detach() override; |
102 virtual void specifiedTimingChanged() override; | 102 void specifiedTimingChanged() override; |
103 virtual double calculateTimeToEffectChange(bool forwards, double inheritedTi
me, double timeToNextIteration) const override; | 103 double calculateTimeToEffectChange(bool forwards, double inheritedTime, doub
le timeToNextIteration) const override; |
104 virtual bool hasIncompatibleStyle(); | 104 virtual bool hasIncompatibleStyle(); |
105 bool hasMultipleTransformProperties() const; | 105 bool hasMultipleTransformProperties() const; |
106 | 106 |
107 private: | 107 private: |
108 KeyframeEffect(Element*, PassRefPtrWillBeRawPtr<EffectModel>, const Timing&,
Priority, PassOwnPtrWillBeRawPtr<EventDelegate>); | 108 KeyframeEffect(Element*, PassRefPtrWillBeRawPtr<EffectModel>, const Timing&,
Priority, PassOwnPtrWillBeRawPtr<EventDelegate>); |
109 | 109 |
110 RawPtrWillBeMember<Element> m_target; | 110 RawPtrWillBeMember<Element> m_target; |
111 RefPtrWillBeMember<EffectModel> m_model; | 111 RefPtrWillBeMember<EffectModel> m_model; |
112 RawPtrWillBeMember<SampledEffect> m_sampledEffect; | 112 RawPtrWillBeMember<SampledEffect> m_sampledEffect; |
113 | 113 |
114 Priority m_priority; | 114 Priority m_priority; |
115 | 115 |
116 Vector<int> m_compositorAnimationIds; | 116 Vector<int> m_compositorAnimationIds; |
117 | 117 |
118 friend class AnimationAnimationV8Test; | 118 friend class AnimationAnimationV8Test; |
119 }; | 119 }; |
120 | 120 |
121 DEFINE_TYPE_CASTS(KeyframeEffect, AnimationEffect, animationNode, animationNode-
>isAnimation(), animationNode.isAnimation()); | 121 DEFINE_TYPE_CASTS(KeyframeEffect, AnimationEffect, animationNode, animationNode-
>isAnimation(), animationNode.isAnimation()); |
122 | 122 |
123 } // namespace blink | 123 } // namespace blink |
124 | 124 |
125 #endif // KeyframeEffect_h | 125 #endif // KeyframeEffect_h |
OLD | NEW |