Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: Source/core/animation/IntegerSVGInterpolation.h

Issue 1120003002: [Oilpan] Migrate most classes under core/animations to Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 IntegerSVGInterpolation_h 5 #ifndef IntegerSVGInterpolation_h
6 #define IntegerSVGInterpolation_h 6 #define IntegerSVGInterpolation_h
7 7
8 #include "core/animation/SVGInterpolation.h" 8 #include "core/animation/SVGInterpolation.h"
9 #include "core/svg/SVGInteger.h" 9 #include "core/svg/SVGInteger.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 class IntegerSVGInterpolation : public SVGInterpolation { 13 class IntegerSVGInterpolation : public SVGInterpolation {
14 public: 14 public:
15 static PassRefPtrWillBeRawPtr<IntegerSVGInterpolation> create(SVGPropertyBas e* start, SVGPropertyBase* end, PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase> attribute) 15 static IntegerSVGInterpolation* create(SVGPropertyBase* start, SVGPropertyBa se* end, PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase> attribute)
16 { 16 {
17 return adoptRefWillBeNoop(new IntegerSVGInterpolation(toInterpolableValu e(start), toInterpolableValue(end), attribute)); 17 return new IntegerSVGInterpolation(toInterpolableValue(start), toInterpo lableValue(end), attribute);
18 } 18 }
19 19
20 PassRefPtrWillBeRawPtr<SVGPropertyBase> interpolatedValue(SVGElement&) const final 20 PassRefPtrWillBeRawPtr<SVGPropertyBase> interpolatedValue(SVGElement&) const final
21 { 21 {
22 return fromInterpolableValue(*m_cachedValue); 22 return fromInterpolableValue(*m_cachedValue);
23 } 23 }
24 24
25 DEFINE_INLINE_VIRTUAL_TRACE() 25 DEFINE_INLINE_VIRTUAL_TRACE()
26 { 26 {
27 SVGInterpolation::trace(visitor); 27 SVGInterpolation::trace(visitor);
28 } 28 }
29 29
30 private: 30 private:
31 IntegerSVGInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, Pas sOwnPtrWillBeRawPtr<InterpolableValue> end, PassRefPtrWillBeRawPtr<SVGAnimatedPr opertyBase> attribute) 31 IntegerSVGInterpolation(InterpolableValue* start, InterpolableValue* end, Pa ssRefPtrWillBeRawPtr<SVGAnimatedPropertyBase> attribute)
32 : SVGInterpolation(start, end, attribute) 32 : SVGInterpolation(start, end, attribute)
33 { 33 {
34 } 34 }
35 35
36 static PassOwnPtrWillBeRawPtr<InterpolableValue> toInterpolableValue(SVGProp ertyBase* value) 36 static InterpolableValue* toInterpolableValue(SVGPropertyBase* value)
37 { 37 {
38 return InterpolableNumber::create(toSVGInteger(value)->value()); 38 return InterpolableNumber::create(toSVGInteger(value)->value());
39 } 39 }
40 40
41 static PassRefPtrWillBeRawPtr<SVGInteger> fromInterpolableValue(const Interp olableValue& value) 41 static PassRefPtrWillBeRawPtr<SVGInteger> fromInterpolableValue(const Interp olableValue& value)
42 { 42 {
43 return SVGInteger::create(clampTo<int>(roundf(toInterpolableNumber(value ).value()))); 43 return SVGInteger::create(clampTo<int>(roundf(toInterpolableNumber(value ).value())));
44 } 44 }
45 }; 45 };
46 46
47 } 47 }
48 48
49 #endif // IntegerSVGInterpolation_h 49 #endif // IntegerSVGInterpolation_h
OLDNEW
« no previous file with comments | « Source/core/animation/IntegerOptionalIntegerSVGInterpolation.cpp ('k') | Source/core/animation/InterpolableValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698