| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SVGInterpolation_h | 5 #ifndef SVGInterpolation_h |
| 6 #define SVGInterpolation_h | 6 #define SVGInterpolation_h |
| 7 | 7 |
| 8 #include "core/animation/Interpolation.h" | 8 #include "core/animation/Interpolation.h" |
| 9 #include "core/animation/PropertyHandle.h" | 9 #include "core/animation/PropertyHandle.h" |
| 10 #include "core/svg/properties/SVGAnimatedProperty.h" | 10 #include "core/svg/properties/SVGAnimatedProperty.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class SVGInterpolation : public Interpolation { | 14 class SVGInterpolation : public Interpolation { |
| 15 public: | 15 public: |
| 16 virtual bool isSVGInterpolation() const override final { return true; } | 16 bool isSVGInterpolation() const final { return true; } |
| 17 | 17 |
| 18 SVGAnimatedPropertyBase* attribute() const { return m_attribute.get(); } | 18 SVGAnimatedPropertyBase* attribute() const { return m_attribute.get(); } |
| 19 | 19 |
| 20 const QualifiedName& attributeName() const { return m_attribute->attributeNa
me(); } | 20 const QualifiedName& attributeName() const { return m_attribute->attributeNa
me(); } |
| 21 | 21 |
| 22 virtual PropertyHandle property() const override final | 22 PropertyHandle property() const final |
| 23 { | 23 { |
| 24 return PropertyHandle(attributeName()); | 24 return PropertyHandle(attributeName()); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void apply(SVGElement&) const; | 27 void apply(SVGElement&) const; |
| 28 | 28 |
| 29 virtual PassRefPtrWillBeRawPtr<SVGPropertyBase> interpolatedValue(SVGElement
&) const = 0; | 29 virtual PassRefPtrWillBeRawPtr<SVGPropertyBase> interpolatedValue(SVGElement
&) const = 0; |
| 30 | 30 |
| 31 DEFINE_INLINE_VIRTUAL_TRACE() | 31 DEFINE_INLINE_VIRTUAL_TRACE() |
| 32 { | 32 { |
| 33 visitor->trace(m_attribute); | 33 visitor->trace(m_attribute); |
| 34 Interpolation::trace(visitor); | 34 Interpolation::trace(visitor); |
| 35 } | 35 } |
| 36 | 36 |
| 37 protected: | 37 protected: |
| 38 SVGInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassOwnPtr
WillBeRawPtr<InterpolableValue> end, PassRefPtrWillBeRawPtr<SVGAnimatedPropertyB
ase> attribute) | 38 SVGInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassOwnPtr
WillBeRawPtr<InterpolableValue> end, PassRefPtrWillBeRawPtr<SVGAnimatedPropertyB
ase> attribute) |
| 39 : Interpolation(start, end) | 39 : Interpolation(start, end) |
| 40 , m_attribute(attribute) | 40 , m_attribute(attribute) |
| 41 { | 41 { |
| 42 } | 42 } |
| 43 | 43 |
| 44 RefPtrWillBeMember<SVGAnimatedPropertyBase> m_attribute; | 44 RefPtrWillBeMember<SVGAnimatedPropertyBase> m_attribute; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 DEFINE_TYPE_CASTS(SVGInterpolation, Interpolation, value, value->isSVGInterpolat
ion(), value.isSVGInterpolation()); | 47 DEFINE_TYPE_CASTS(SVGInterpolation, Interpolation, value, value->isSVGInterpolat
ion(), value.isSVGInterpolation()); |
| 48 | 48 |
| 49 } | 49 } |
| 50 | 50 |
| 51 #endif // SVGInterpolation_h | 51 #endif // SVGInterpolation_h |
| OLD | NEW |