| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef AnimatableValueKeyframe_h | 5 #ifndef AnimatableValueKeyframe_h |
| 6 #define AnimatableValueKeyframe_h | 6 #define AnimatableValueKeyframe_h |
| 7 | 7 |
| 8 #include "core/animation/Keyframe.h" | 8 #include "core/animation/Keyframe.h" |
| 9 #include "core/animation/animatable/AnimatableValue.h" | 9 #include "core/animation/animatable/AnimatableValue.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class AnimatableValueKeyframe : public Keyframe { | 13 class AnimatableValueKeyframe : public Keyframe { |
| 14 public: | 14 public: |
| 15 static PassRefPtrWillBeRawPtr<AnimatableValueKeyframe> create() | 15 static PassRefPtrWillBeRawPtr<AnimatableValueKeyframe> create() |
| 16 { | 16 { |
| 17 return adoptRefWillBeNoop(new AnimatableValueKeyframe); | 17 return adoptRefWillBeNoop(new AnimatableValueKeyframe); |
| 18 } | 18 } |
| 19 void setPropertyValue(CSSPropertyID property, PassRefPtrWillBeRawPtr<Animata
bleValue> value) | 19 void setPropertyValue(CSSPropertyID property, PassRefPtrWillBeRawPtr<Animata
bleValue> value) |
| 20 { | 20 { |
| 21 m_propertyValues.add(property, value); | 21 m_propertyValues.add(property, value); |
| 22 } | 22 } |
| 23 void clearPropertyValue(CSSPropertyID property) { m_propertyValues.remove(pr
operty); } | 23 void clearPropertyValue(CSSPropertyID property) { m_propertyValues.remove(pr
operty); } |
| 24 AnimatableValue* propertyValue(CSSPropertyID property) const | 24 AnimatableValue* propertyValue(CSSPropertyID property) const |
| 25 { | 25 { |
| 26 ASSERT(m_propertyValues.contains(property)); | 26 ASSERT(m_propertyValues.contains(property)); |
| 27 return m_propertyValues.get(property); | 27 return m_propertyValues.get(property); |
| 28 } | 28 } |
| 29 virtual PropertySet properties() const OVERRIDE; | 29 virtual PropertySet properties() const override; |
| 30 | 30 |
| 31 virtual void trace(Visitor*) OVERRIDE; | 31 virtual void trace(Visitor*) override; |
| 32 | 32 |
| 33 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { | 33 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { |
| 34 public: | 34 public: |
| 35 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, const AnimatableValue*, AnimationEffect::CompositeOperation); | 35 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, const AnimatableValue*, AnimationEffect::CompositeOperation); |
| 36 | 36 |
| 37 AnimatableValue* value() const { return m_value.get(); } | 37 AnimatableValue* value() const { return m_value.get(); } |
| 38 virtual const PassRefPtrWillBeRawPtr<AnimatableValue> getAnimatableValue
() const OVERRIDE FINAL { return m_value; } | 38 virtual const PassRefPtrWillBeRawPtr<AnimatableValue> getAnimatableValue
() const override final { return m_value; } |
| 39 | 39 |
| 40 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutr
alKeyframe(double offset, PassRefPtr<TimingFunction> easing) const OVERRIDE FINA
L; | 40 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutr
alKeyframe(double offset, PassRefPtr<TimingFunction> easing) const override fina
l; |
| 41 virtual PassRefPtrWillBeRawPtr<Interpolation> createInterpolation(CSSPro
pertyID, blink::Keyframe::PropertySpecificKeyframe* end, Element*) const OVERRID
E FINAL; | 41 virtual PassRefPtrWillBeRawPtr<Interpolation> createInterpolation(CSSPro
pertyID, blink::Keyframe::PropertySpecificKeyframe* end, Element*) const overrid
e final; |
| 42 | 42 |
| 43 virtual void trace(Visitor*) OVERRIDE; | 43 virtual void trace(Visitor*) override; |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, PassRefPtrWillBeRawPtr<AnimatableValue>); | 46 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, PassRefPtrWillBeRawPtr<AnimatableValue>); |
| 47 | 47 |
| 48 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone
WithOffset(double offset) const OVERRIDE; | 48 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone
WithOffset(double offset) const override; |
| 49 virtual bool isAnimatableValuePropertySpecificKeyframe() const OVERRIDE
{ return true; } | 49 virtual bool isAnimatableValuePropertySpecificKeyframe() const override
{ return true; } |
| 50 | 50 |
| 51 RefPtrWillBeMember<AnimatableValue> m_value; | 51 RefPtrWillBeMember<AnimatableValue> m_value; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 AnimatableValueKeyframe() { } | 55 AnimatableValueKeyframe() { } |
| 56 | 56 |
| 57 AnimatableValueKeyframe(const AnimatableValueKeyframe& copyFrom); | 57 AnimatableValueKeyframe(const AnimatableValueKeyframe& copyFrom); |
| 58 | 58 |
| 59 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const OVERRIDE; | 59 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const override; |
| 60 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> createPro
pertySpecificKeyframe(CSSPropertyID) const OVERRIDE; | 60 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> createPro
pertySpecificKeyframe(CSSPropertyID) const override; |
| 61 | 61 |
| 62 virtual bool isAnimatableValueKeyframe() const OVERRIDE { return true; } | 62 virtual bool isAnimatableValueKeyframe() const override { return true; } |
| 63 | 63 |
| 64 typedef WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<AnimatableValue>
> PropertyValueMap; | 64 typedef WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<AnimatableValue>
> PropertyValueMap; |
| 65 PropertyValueMap m_propertyValues; | 65 PropertyValueMap m_propertyValues; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 typedef AnimatableValueKeyframe::PropertySpecificKeyframe AnimatableValuePropert
ySpecificKeyframe; | 68 typedef AnimatableValueKeyframe::PropertySpecificKeyframe AnimatableValuePropert
ySpecificKeyframe; |
| 69 | 69 |
| 70 DEFINE_TYPE_CASTS(AnimatableValueKeyframe, Keyframe, value, value->isAnimatableV
alueKeyframe(), value.isAnimatableValueKeyframe()); | 70 DEFINE_TYPE_CASTS(AnimatableValueKeyframe, Keyframe, value, value->isAnimatableV
alueKeyframe(), value.isAnimatableValueKeyframe()); |
| 71 DEFINE_TYPE_CASTS(AnimatableValuePropertySpecificKeyframe, Keyframe::PropertySpe
cificKeyframe, value, value->isAnimatableValuePropertySpecificKeyframe(), value.
isAnimatableValuePropertySpecificKeyframe()); | 71 DEFINE_TYPE_CASTS(AnimatableValuePropertySpecificKeyframe, Keyframe::PropertySpe
cificKeyframe, value, value->isAnimatableValuePropertySpecificKeyframe(), value.
isAnimatableValuePropertySpecificKeyframe()); |
| 72 | 72 |
| 73 } | 73 } |
| 74 | 74 |
| 75 #endif | 75 #endif |
| OLD | NEW |