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 Interpolation_h | 5 #ifndef Interpolation_h |
6 #define Interpolation_h | 6 #define Interpolation_h |
7 | 7 |
8 #include "CSSPropertyNames.h" | 8 #include "CSSPropertyNames.h" |
9 #include "core/animation/InterpolableValue.h" | 9 #include "core/animation/InterpolableValue.h" |
10 #include "wtf/RefCounted.h" | 10 #include "wtf/RefCounted.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 CSSPropertyID m_id; | 64 CSSPropertyID m_id; |
65 | 65 |
66 StyleInterpolation(PassOwnPtr<InterpolableValue> start, PassOwnPtr<Interpola
bleValue> end, CSSPropertyID id) | 66 StyleInterpolation(PassOwnPtr<InterpolableValue> start, PassOwnPtr<Interpola
bleValue> end, CSSPropertyID id) |
67 : Interpolation(start, end) | 67 : Interpolation(start, end) |
68 , m_id(id) | 68 , m_id(id) |
69 { } | 69 { } |
70 }; | 70 }; |
71 | 71 |
72 class LegacyStyleInterpolation : public StyleInterpolation { | 72 class LegacyStyleInterpolation : public StyleInterpolation { |
73 public: | 73 public: |
74 static PassRefPtr<LegacyStyleInterpolation> create(PassRefPtr<AnimatableValu
e> start, PassRefPtr<AnimatableValue> end, CSSPropertyID id) | 74 static PassRefPtr<LegacyStyleInterpolation> create(PassRefPtrWillBeRawPtr<An
imatableValue> start, PassRefPtrWillBeRawPtr<AnimatableValue> end, CSSPropertyID
id) |
75 { | 75 { |
76 return adoptRef(new LegacyStyleInterpolation(InterpolableAnimatableValue
::create(start), InterpolableAnimatableValue::create(end), id)); | 76 return adoptRef(new LegacyStyleInterpolation(InterpolableAnimatableValue
::create(start), InterpolableAnimatableValue::create(end), id)); |
77 } | 77 } |
78 | 78 |
79 virtual void apply(StyleResolverState&) const; | 79 virtual void apply(StyleResolverState&) const; |
80 | 80 |
81 virtual bool isLegacyStyleInterpolation() const OVERRIDE FINAL { return true
; } | 81 virtual bool isLegacyStyleInterpolation() const OVERRIDE FINAL { return true
; } |
82 AnimatableValue* currentValue() const | 82 AnimatableValue* currentValue() const |
83 { | 83 { |
84 InterpolableAnimatableValue *value = static_cast<InterpolableAnimatableV
alue *>(m_cachedValue.get()); | 84 InterpolableAnimatableValue* value = static_cast<InterpolableAnimatableV
alue*>(m_cachedValue.get()); |
85 return value->value(); | 85 return value->value(); |
86 } | 86 } |
87 | 87 |
88 private: | 88 private: |
89 LegacyStyleInterpolation(PassOwnPtr<InterpolableValue> start, PassOwnPtr<Int
erpolableValue> end, CSSPropertyID id) | 89 LegacyStyleInterpolation(PassOwnPtr<InterpolableValue> start, PassOwnPtr<Int
erpolableValue> end, CSSPropertyID id) |
90 : StyleInterpolation(start, end, id) | 90 : StyleInterpolation(start, end, id) |
91 { } | 91 { } |
92 }; | 92 }; |
93 | 93 |
94 DEFINE_TYPE_CASTS(StyleInterpolation, Interpolation, value, value->isStyleInterp
olation(), value.isStyleInterpolation()); | 94 DEFINE_TYPE_CASTS(StyleInterpolation, Interpolation, value, value->isStyleInterp
olation(), value.isStyleInterpolation()); |
95 DEFINE_TYPE_CASTS(LegacyStyleInterpolation, Interpolation, value, value->isLegac
yStyleInterpolation(), value.isLegacyStyleInterpolation()); | 95 DEFINE_TYPE_CASTS(LegacyStyleInterpolation, Interpolation, value, value->isLegac
yStyleInterpolation(), value.isLegacyStyleInterpolation()); |
96 | 96 |
97 } | 97 } |
98 #endif | 98 #endif |
OLD | NEW |