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

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

Issue 2286233002: Replaced PassRefPtr copies with moves in Source/core/animation. (Closed)
Patch Set: Created 4 years, 3 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 InterpolableValue_h 5 #ifndef InterpolableValue_h
6 #define InterpolableValue_h 6 #define InterpolableValue_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/animation/animatable/AnimatableValue.h" 9 #include "core/animation/animatable/AnimatableValue.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 155
156 Vector<std::unique_ptr<InterpolableValue>> m_values; 156 Vector<std::unique_ptr<InterpolableValue>> m_values;
157 }; 157 };
158 158
159 // FIXME: Remove this when we can. 159 // FIXME: Remove this when we can.
160 class InterpolableAnimatableValue : public InterpolableValue { 160 class InterpolableAnimatableValue : public InterpolableValue {
161 public: 161 public:
162 static std::unique_ptr<InterpolableAnimatableValue> create(PassRefPtr<Animat ableValue> value) 162 static std::unique_ptr<InterpolableAnimatableValue> create(PassRefPtr<Animat ableValue> value)
163 { 163 {
164 return wrapUnique(new InterpolableAnimatableValue(value)); 164 return wrapUnique(new InterpolableAnimatableValue(std::move(value)));
165 } 165 }
166 166
167 bool isAnimatableValue() const final { return true; } 167 bool isAnimatableValue() const final { return true; }
168 AnimatableValue* value() const { return m_value.get(); } 168 AnimatableValue* value() const { return m_value.get(); }
169 bool equals(const InterpolableValue&) const final { NOTREACHED(); return fal se; } 169 bool equals(const InterpolableValue&) const final { NOTREACHED(); return fal se; }
170 std::unique_ptr<InterpolableValue> clone() const final { return create(m_val ue); } 170 std::unique_ptr<InterpolableValue> clone() const final { return create(m_val ue); }
171 std::unique_ptr<InterpolableValue> cloneAndZero() const final { NOTREACHED() ; return nullptr; } 171 std::unique_ptr<InterpolableValue> cloneAndZero() const final { NOTREACHED() ; return nullptr; }
172 void scale(double scale) final { NOTREACHED(); } 172 void scale(double scale) final { NOTREACHED(); }
173 void scaleAndAdd(double scale, const InterpolableValue& other) final { NOTRE ACHED(); } 173 void scaleAndAdd(double scale, const InterpolableValue& other) final { NOTRE ACHED(); }
174 174
175 private: 175 private:
176 void interpolate(const InterpolableValue &to, const double progress, Interpo lableValue& result) const final; 176 void interpolate(const InterpolableValue &to, const double progress, Interpo lableValue& result) const final;
177 RefPtr<AnimatableValue> m_value; 177 RefPtr<AnimatableValue> m_value;
178 178
179 InterpolableAnimatableValue(PassRefPtr<AnimatableValue> value) 179 InterpolableAnimatableValue(PassRefPtr<AnimatableValue> value)
180 : m_value(value) 180 : m_value(value)
181 { 181 {
182 } 182 }
183 }; 183 };
184 184
185 DEFINE_TYPE_CASTS(InterpolableNumber, InterpolableValue, value, value->isNumber( ), value.isNumber()); 185 DEFINE_TYPE_CASTS(InterpolableNumber, InterpolableValue, value, value->isNumber( ), value.isNumber());
186 DEFINE_TYPE_CASTS(InterpolableBool, InterpolableValue, value, value->isBool(), v alue.isBool()); 186 DEFINE_TYPE_CASTS(InterpolableBool, InterpolableValue, value, value->isBool(), v alue.isBool());
187 DEFINE_TYPE_CASTS(InterpolableList, InterpolableValue, value, value->isList(), v alue.isList()); 187 DEFINE_TYPE_CASTS(InterpolableList, InterpolableValue, value, value->isList(), v alue.isList());
188 DEFINE_TYPE_CASTS(InterpolableAnimatableValue, InterpolableValue, value, value-> isAnimatableValue(), value.isAnimatableValue()); 188 DEFINE_TYPE_CASTS(InterpolableAnimatableValue, InterpolableValue, value, value-> isAnimatableValue(), value.isAnimatableValue());
189 189
190 } // namespace blink 190 } // namespace blink
191 191
192 #endif 192 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698