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

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

Issue 1302463002: Make classes and structures in Source/core/animation fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 PointSVGInterpolation_h 5 #ifndef PointSVGInterpolation_h
6 #define PointSVGInterpolation_h 6 #define PointSVGInterpolation_h
7 7
8 #include "core/animation/SVGInterpolation.h" 8 #include "core/animation/SVGInterpolation.h"
9 #include "core/svg/SVGPointList.h" 9 #include "core/svg/SVGPointList.h"
10 #include "wtf/Allocator.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 class PointSVGInterpolation { 14 class PointSVGInterpolation {
15 STATIC_ONLY(PointSVGInterpolation);
14 public: 16 public:
15 typedef SVGPointList ListType; 17 typedef SVGPointList ListType;
16 typedef void NonInterpolableType; 18 typedef void NonInterpolableType;
17 19
18 static PassOwnPtrWillBeRawPtr<InterpolableList> toInterpolableValue(SVGPrope rtyBase* item) 20 static PassOwnPtrWillBeRawPtr<InterpolableList> toInterpolableValue(SVGPrope rtyBase* item)
19 { 21 {
20 OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(2 ); 22 OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(2 );
21 result->set(0, InterpolableNumber::create(toSVGPoint(item)->x())); 23 result->set(0, InterpolableNumber::create(toSVGPoint(item)->x()));
22 result->set(1, InterpolableNumber::create(toSVGPoint(item)->y())); 24 result->set(1, InterpolableNumber::create(toSVGPoint(item)->y()));
23 return result.release(); 25 return result.release();
24 } 26 }
25 27
26 static PassRefPtrWillBeRawPtr<SVGPoint> fromInterpolableValue(const Interpol ableValue& value) 28 static PassRefPtrWillBeRawPtr<SVGPoint> fromInterpolableValue(const Interpol ableValue& value)
27 { 29 {
28 const InterpolableList& list = toInterpolableList(value); 30 const InterpolableList& list = toInterpolableList(value);
29 return SVGPoint::create(FloatPoint( 31 return SVGPoint::create(FloatPoint(
30 toInterpolableNumber(list.get(0))->value(), 32 toInterpolableNumber(list.get(0))->value(),
31 toInterpolableNumber(list.get(1))->value())); 33 toInterpolableNumber(list.get(1))->value()));
32 } 34 }
33 }; 35 };
34 36
35 } 37 }
36 38
37 #endif // PointSVGInterpolation_h 39 #endif // PointSVGInterpolation_h
OLDNEW
« no previous file with comments | « Source/core/animation/LengthSVGInterpolation.h ('k') | Source/core/animation/PrimitiveInterpolation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698