| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SVGInterpolation_h | |
| 6 #define SVGInterpolation_h | |
| 7 | |
| 8 #include "core/animation/Interpolation.h" | |
| 9 #include "core/animation/PropertyHandle.h" | |
| 10 #include "core/svg/properties/SVGAnimatedProperty.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 class SVGInterpolation : public Interpolation { | |
| 15 public: | |
| 16 bool isSVGInterpolation() const final { return true; } | |
| 17 | |
| 18 SVGAnimatedPropertyBase* attribute() const { return m_attribute.get(); } | |
| 19 | |
| 20 const QualifiedName& attributeName() const { return m_attribute->attributeNa
me(); } | |
| 21 | |
| 22 PropertyHandle property() const final | |
| 23 { | |
| 24 return PropertyHandle(attributeName()); | |
| 25 } | |
| 26 | |
| 27 void apply(SVGElement& targetElement) const | |
| 28 { | |
| 29 targetElement.setWebAnimatedAttribute(attributeName(), interpolatedValue
(targetElement)); | |
| 30 } | |
| 31 | |
| 32 virtual PassRefPtrWillBeRawPtr<SVGPropertyBase> interpolatedValue(SVGElement
&) const = 0; | |
| 33 | |
| 34 protected: | |
| 35 SVGInterpolation(PassOwnPtr<InterpolableValue> start, PassOwnPtr<Interpolabl
eValue> end, PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase> attribute) | |
| 36 : Interpolation(start, end) | |
| 37 , m_attribute(attribute) | |
| 38 { | |
| 39 } | |
| 40 | |
| 41 RefPtrWillBePersistent<SVGAnimatedPropertyBase> m_attribute; | |
| 42 }; | |
| 43 | |
| 44 DEFINE_TYPE_CASTS(SVGInterpolation, Interpolation, value, value->isSVGInterpolat
ion(), value.isSVGInterpolation()); | |
| 45 | |
| 46 } | |
| 47 | |
| 48 #endif // SVGInterpolation_h | |
| OLD | NEW |