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 InterpolableValue_h | 5 #ifndef InterpolableValue_h |
6 #define InterpolableValue_h | 6 #define InterpolableValue_h |
7 | 7 |
8 #include "core/animation/AnimatableValue.h" | 8 #include "core/animation/AnimatableValue.h" |
9 #include "wtf/OwnPtr.h" | 9 #include "wtf/OwnPtr.h" |
10 #include "wtf/PassOwnPtr.h" | 10 #include "wtf/PassOwnPtr.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 set(i, other.m_values.get()[i]->clone()); | 117 set(i, other.m_values.get()[i]->clone()); |
118 } | 118 } |
119 | 119 |
120 size_t m_size; | 120 size_t m_size; |
121 OwnPtr<OwnPtr<InterpolableValue>[]> m_values; | 121 OwnPtr<OwnPtr<InterpolableValue>[]> m_values; |
122 }; | 122 }; |
123 | 123 |
124 // FIXME: Remove this when we can. | 124 // FIXME: Remove this when we can. |
125 class InterpolableAnimatableValue : public InterpolableValue { | 125 class InterpolableAnimatableValue : public InterpolableValue { |
126 public: | 126 public: |
127 static PassOwnPtr<InterpolableAnimatableValue> create(PassRefPtr<AnimatableV
alue> value) | 127 static PassOwnPtr<InterpolableAnimatableValue> create(PassRefPtrWillBeRawPtr
<AnimatableValue> value) |
128 { | 128 { |
129 return adoptPtr(new InterpolableAnimatableValue(value)); | 129 return adoptPtr(new InterpolableAnimatableValue(value)); |
130 } | 130 } |
131 | 131 |
132 virtual bool isAnimatableValue() const OVERRIDE FINAL { return true; } | 132 virtual bool isAnimatableValue() const OVERRIDE FINAL { return true; } |
133 AnimatableValue* value() const { return m_value.get(); } | 133 AnimatableValue* value() const { return m_value.get(); } |
134 virtual PassOwnPtr<InterpolableValue> clone() const OVERRIDE FINAL { return
create(m_value); } | 134 virtual PassOwnPtr<InterpolableValue> clone() const OVERRIDE FINAL { return
create(m_value); } |
135 | 135 |
136 private: | 136 private: |
137 virtual PassOwnPtr<InterpolableValue> interpolate(const InterpolableValue &o
ther, const double progress) const OVERRIDE FINAL; | 137 virtual PassOwnPtr<InterpolableValue> interpolate(const InterpolableValue &o
ther, const double progress) const OVERRIDE FINAL; |
138 RefPtr<AnimatableValue> m_value; | 138 RefPtrWillBePersistent<AnimatableValue> m_value; |
139 | 139 |
140 InterpolableAnimatableValue(PassRefPtr<AnimatableValue> value) | 140 InterpolableAnimatableValue(PassRefPtrWillBeRawPtr<AnimatableValue> value) |
141 : m_value(value) | 141 : m_value(value) |
142 { } | 142 { } |
143 }; | 143 }; |
144 | 144 |
145 DEFINE_TYPE_CASTS(InterpolableNumber, InterpolableValue, value, value->isNumber(
), value.isNumber()); | 145 DEFINE_TYPE_CASTS(InterpolableNumber, InterpolableValue, value, value->isNumber(
), value.isNumber()); |
146 DEFINE_TYPE_CASTS(InterpolableBool, InterpolableValue, value, value->isBool(), v
alue.isBool()); | 146 DEFINE_TYPE_CASTS(InterpolableBool, InterpolableValue, value, value->isBool(), v
alue.isBool()); |
147 DEFINE_TYPE_CASTS(InterpolableList, InterpolableValue, value, value->isList(), v
alue.isList()); | 147 DEFINE_TYPE_CASTS(InterpolableList, InterpolableValue, value, value->isList(), v
alue.isList()); |
148 DEFINE_TYPE_CASTS(InterpolableAnimatableValue, InterpolableValue, value, value->
isAnimatableValue(), value.isAnimatableValue()); | 148 DEFINE_TYPE_CASTS(InterpolableAnimatableValue, InterpolableValue, value, value->
isAnimatableValue(), value.isAnimatableValue()); |
149 | 149 |
150 } | 150 } |
151 | 151 |
152 #endif | 152 #endif |
OLD | NEW |