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

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

Issue 851633002: Animation: Add template for ListStyleInterpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add template for ListStyleInterpolation Created 5 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 LengthStyleInterpolation_h 5 #ifndef LengthStyleInterpolation_h
6 #define LengthStyleInterpolation_h 6 #define LengthStyleInterpolation_h
7 7
8 #include "core/animation/StyleInterpolation.h" 8 #include "core/animation/StyleInterpolation.h"
9 #include "core/css/CSSPrimitiveValue.h" 9 #include "core/css/CSSPrimitiveValue.h"
10 #include "platform/Length.h" 10 #include "platform/Length.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class LengthStyleInterpolation : public StyleInterpolation { 14 class LengthStyleInterpolation : public StyleInterpolation {
15 public: 15 public:
16
17 typedef void NonInterpolableType;
18
16 static PassRefPtrWillBeRawPtr<LengthStyleInterpolation> create(const CSSValu e& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range) 19 static PassRefPtrWillBeRawPtr<LengthStyleInterpolation> create(const CSSValu e& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range)
17 { 20 {
18 return adoptRefWillBeNoop(new LengthStyleInterpolation(lengthToInterpola bleValue(start), lengthToInterpolableValue(end), id, range)); 21 return adoptRefWillBeNoop(new LengthStyleInterpolation(lengthToInterpola bleValue(start), lengthToInterpolableValue(end), id, range));
19 } 22 }
20 23
21 static bool canCreateFrom(const CSSValue&); 24 static bool canCreateFrom(const CSSValue&);
22 25
23 virtual void apply(StyleResolverState&) const override; 26 virtual void apply(StyleResolverState&) const override;
24 27
25 virtual void trace(Visitor*) override; 28 virtual void trace(Visitor*) override;
26 29
30 static PassOwnPtrWillBeRawPtr<InterpolableValue> toInterpolableValue(const C SSValue&);
31 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> fromInterpolableValue(const InterpolableValue&, InterpolationRange);
32
33 static PassOwnPtrWillBeRawPtr<InterpolableValue> lengthToInterpolableValue(c onst CSSValue& value)
34 {
35 return toInterpolableValue(value);
36 }
37
38 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> interpolableValueToLength(c onst InterpolableValue& value, InterpolationRange range)
39 {
40 return fromInterpolableValue(value, range);
41 }
42
samli 2015/01/23 03:23:36 Don't think there is any value to having lengthToI
evemj (not active) 2015/01/28 00:41:13 Done.
27 private: 43 private:
28 LengthStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, Pa ssOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id, InterpolationRan ge range) 44 LengthStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, Pa ssOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id, InterpolationRan ge range)
29 : StyleInterpolation(start, end, id) 45 : StyleInterpolation(start, end, id)
30 , m_range(range) 46 , m_range(range)
31 { } 47 { }
32 48
33 static PassOwnPtrWillBeRawPtr<InterpolableValue> lengthToInterpolableValue(c onst CSSValue&);
34 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> interpolableValueToLength(c onst InterpolableValue*, InterpolationRange);
35
36 InterpolationRange m_range; 49 InterpolationRange m_range;
37
38 friend class AnimationLengthStyleInterpolationTest;
39 friend class LengthBoxStyleInterpolation;
40 friend class ShadowStyleInterpolation;
41 friend class LengthPairStyleInterpolation;
42 friend class LengthPoint3DStyleInterpolation;
43 }; 50 };
44 51
45 } 52 }
46 53
47 #endif 54 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698