OLD | NEW |
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 ShadowStyleInterpolation_h | 5 #ifndef ShadowStyleInterpolation_h |
6 #define ShadowStyleInterpolation_h | 6 #define ShadowStyleInterpolation_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/animation/StyleInterpolation.h" | 9 #include "core/animation/StyleInterpolation.h" |
10 #include "core/css/CSSShadowValue.h" | 10 #include "core/css/CSSShadowValue.h" |
11 #include "core/style/ComputedStyle.h" | 11 #include "core/style/ComputedStyle.h" |
12 #include "platform/Length.h" | 12 #include "platform/Length.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class CORE_EXPORT ShadowStyleInterpolation : public StyleInterpolation { | 16 class CORE_EXPORT ShadowStyleInterpolation : public StyleInterpolation { |
17 public: | 17 public: |
18 typedef bool NonInterpolableType; | 18 typedef bool NonInterpolableType; |
19 | 19 |
20 static bool canCreateFrom(const CSSValue& start, const CSSValue& end); | 20 static bool canCreateFrom(const CSSValue& start, const CSSValue& end); |
21 | 21 |
22 static bool usesDefaultStyleInterpolation(const CSSValue& start, const CSSVa
lue& end); | 22 static bool usesDefaultStyleInterpolation(const CSSValue& start, const CSSVa
lue& end); |
23 | 23 |
24 static PassOwnPtrWillBeRawPtr<InterpolableValue> toInterpolableValue(const C
SSValue&, NonInterpolableType&); | 24 static InterpolableValue* toInterpolableValue(const CSSValue&, NonInterpolab
leType&); |
25 static PassRefPtrWillBeRawPtr<CSSValue> fromInterpolableValue(const Interpol
ableValue&, NonInterpolableType, InterpolationRange = RangeAll); | 25 static PassRefPtrWillBeRawPtr<CSSValue> fromInterpolableValue(const Interpol
ableValue&, NonInterpolableType, InterpolationRange = RangeAll); |
26 | 26 |
27 private: | 27 private: |
28 ShadowStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, Pa
ssOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id) | 28 ShadowStyleInterpolation(InterpolableValue* start, InterpolableValue* end, C
SSPropertyID id) |
29 : StyleInterpolation(start, end, id) | 29 : StyleInterpolation(start, end, id) |
30 { | 30 { |
31 } | 31 } |
32 | 32 |
33 static PassOwnPtrWillBeRawPtr<InterpolableValue> shadowToInterpolableValue(c
onst CSSValue& value, NonInterpolableType& type) | 33 static InterpolableValue* shadowToInterpolableValue(const CSSValue& value, N
onInterpolableType& type) |
34 { | 34 { |
35 return toInterpolableValue(value, type); | 35 return toInterpolableValue(value, type); |
36 } | 36 } |
37 static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToShadow(const Inte
rpolableValue& value, NonInterpolableType type, InterpolationRange range = Range
All) | 37 static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToShadow(const Inte
rpolableValue& value, NonInterpolableType type, InterpolationRange range = Range
All) |
38 { | 38 { |
39 return fromInterpolableValue(value, type, range); | 39 return fromInterpolableValue(value, type, range); |
40 } | 40 } |
41 | 41 |
42 static PassOwnPtrWillBeRawPtr<InterpolableValue> lengthToInterpolableValue(P
assRefPtrWillBeRawPtr<CSSPrimitiveValue>); | 42 static InterpolableValue* lengthToInterpolableValue(PassRefPtrWillBeRawPtr<C
SSPrimitiveValue>); |
43 | 43 |
44 friend class AnimationShadowStyleInterpolationTest; | 44 friend class AnimationShadowStyleInterpolationTest; |
45 }; | 45 }; |
46 | 46 |
47 } // namespace blink | 47 } // namespace blink |
48 | 48 |
49 #endif // ShadowStyleInterpolation_h | 49 #endif // ShadowStyleInterpolation_h |
OLD | NEW |