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

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

Issue 1418003008: Web Animations: Add SVGPointListInterpolationType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_fixSVGNeutral
Patch Set: Rebase Created 5 years, 1 month 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
(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 PointSVGInterpolation_h
6 #define PointSVGInterpolation_h
7
8 #include "core/animation/SVGInterpolation.h"
9 #include "core/svg/SVGPointList.h"
10 #include "wtf/Allocator.h"
11
12 namespace blink {
13
14 class PointSVGInterpolation {
15 STATIC_ONLY(PointSVGInterpolation);
16 public:
17 typedef SVGPointList ListType;
18 typedef void NonInterpolableType;
19
20 static PassOwnPtr<InterpolableList> toInterpolableValue(SVGPropertyBase* ite m)
21 {
22 OwnPtr<InterpolableList> result = InterpolableList::create(2);
23 result->set(0, InterpolableNumber::create(toSVGPoint(item)->x()));
24 result->set(1, InterpolableNumber::create(toSVGPoint(item)->y()));
25 return result.release();
26 }
27
28 static PassRefPtrWillBeRawPtr<SVGPoint> fromInterpolableValue(const Interpol ableValue& value)
29 {
30 const InterpolableList& list = toInterpolableList(value);
31 return SVGPoint::create(FloatPoint(
32 toInterpolableNumber(list.get(0))->value(),
33 toInterpolableNumber(list.get(1))->value()));
34 }
35 };
36
37 }
38
39 #endif // PointSVGInterpolation_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698