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 IntegerOptionalIntegerSVGInterpolation_h | |
6 #define IntegerOptionalIntegerSVGInterpolation_h | |
7 | |
8 #include "core/animation/SVGInterpolation.h" | |
9 #include "core/svg/SVGIntegerOptionalInteger.h" | |
10 #include "platform/heap/Handle.h" | |
11 | |
12 namespace blink { | |
13 | |
14 class SVGIntegerOptionalInteger; | |
15 | |
16 class IntegerOptionalIntegerSVGInterpolation : public SVGInterpolation { | |
17 public: | |
18 static PassRefPtr<IntegerOptionalIntegerSVGInterpolation> create(SVGProperty
Base* start, SVGPropertyBase* end, PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBas
e> attribute, int min) | |
19 { | |
20 return adoptRef(new IntegerOptionalIntegerSVGInterpolation(toInterpolabl
eValue(start), toInterpolableValue(end), attribute, min)); | |
21 } | |
22 | |
23 PassRefPtrWillBeRawPtr<SVGPropertyBase> interpolatedValue(SVGElement&) const
final | |
24 { | |
25 return fromInterpolableValue(*m_cachedValue, m_min); | |
26 } | |
27 | |
28 private: | |
29 IntegerOptionalIntegerSVGInterpolation(PassOwnPtr<InterpolableValue> start,
PassOwnPtr<InterpolableValue> end, PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBas
e> attribute, int min) | |
30 : SVGInterpolation(start, end, attribute) | |
31 , m_min(min) | |
32 { | |
33 } | |
34 | |
35 static PassOwnPtr<InterpolableValue> toInterpolableValue(SVGPropertyBase*); | |
36 | |
37 static PassRefPtrWillBeRawPtr<SVGIntegerOptionalInteger> fromInterpolableVal
ue(const InterpolableValue&, int); | |
38 | |
39 const int m_min; | |
40 }; | |
41 | |
42 } | |
43 | |
44 #endif // IntegerOptionalIntegerSVGInterpolation_h | |
OLD | NEW |