| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 InterpolationValue_h | 5 #ifndef InterpolationValue_h |
| 6 #define InterpolationValue_h | 6 #define InterpolationValue_h |
| 7 | 7 |
| 8 #include "core/animation/InterpolableValue.h" | 8 #include "core/animation/InterpolableValue.h" |
| 9 #include "core/animation/NonInterpolableValue.h" | 9 #include "core/animation/NonInterpolableValue.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 explicit InterpolationValue( | 21 explicit InterpolationValue( |
| 22 std::unique_ptr<InterpolableValue> interpolableValue, | 22 std::unique_ptr<InterpolableValue> interpolableValue, |
| 23 PassRefPtr<NonInterpolableValue> nonInterpolableValue = nullptr) | 23 PassRefPtr<NonInterpolableValue> nonInterpolableValue = nullptr) |
| 24 : interpolableValue(std::move(interpolableValue)), | 24 : interpolableValue(std::move(interpolableValue)), |
| 25 nonInterpolableValue(nonInterpolableValue) {} | 25 nonInterpolableValue(nonInterpolableValue) {} |
| 26 | 26 |
| 27 InterpolationValue(std::nullptr_t) {} | 27 InterpolationValue(std::nullptr_t) {} |
| 28 | 28 |
| 29 InterpolationValue(InterpolationValue&& other) | 29 InterpolationValue(InterpolationValue&& other) |
| 30 : interpolableValue(std::move(other.interpolableValue)), | 30 : interpolableValue(std::move(other.interpolableValue)), |
| 31 nonInterpolableValue(other.nonInterpolableValue.release()) {} | 31 nonInterpolableValue(std::move(other.nonInterpolableValue)) {} |
| 32 | 32 |
| 33 void operator=(InterpolationValue&& other) { | 33 void operator=(InterpolationValue&& other) { |
| 34 interpolableValue = std::move(other.interpolableValue); | 34 interpolableValue = std::move(other.interpolableValue); |
| 35 nonInterpolableValue = other.nonInterpolableValue.release(); | 35 nonInterpolableValue = std::move(other.nonInterpolableValue); |
| 36 } | 36 } |
| 37 | 37 |
| 38 operator bool() const { return interpolableValue.get(); } | 38 operator bool() const { return interpolableValue.get(); } |
| 39 | 39 |
| 40 InterpolationValue clone() const { | 40 InterpolationValue clone() const { |
| 41 return InterpolationValue( | 41 return InterpolationValue( |
| 42 interpolableValue ? interpolableValue->clone() : nullptr, | 42 interpolableValue ? interpolableValue->clone() : nullptr, |
| 43 nonInterpolableValue); | 43 nonInterpolableValue); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void clear() { | 46 void clear() { |
| 47 interpolableValue.reset(); | 47 interpolableValue.reset(); |
| 48 nonInterpolableValue.clear(); | 48 nonInterpolableValue.clear(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 std::unique_ptr<InterpolableValue> interpolableValue; | 51 std::unique_ptr<InterpolableValue> interpolableValue; |
| 52 RefPtr<NonInterpolableValue> nonInterpolableValue; | 52 RefPtr<NonInterpolableValue> nonInterpolableValue; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace blink | 55 } // namespace blink |
| 56 | 56 |
| 57 #endif // InterpolationValue_h | 57 #endif // InterpolationValue_h |
| OLD | NEW |