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" |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 // Represents a (non-strict) subset of a PropertySpecificKeyframe's value broken | 15 // Represents a (non-strict) subset of a PropertySpecificKeyframe's value broken |
16 // down into interpolable and non-interpolable parts. InterpolationValues can be | 16 // down into interpolable and non-interpolable parts. InterpolationValues can be |
17 // composed together to represent a whole PropertySpecificKeyframe value. | 17 // composed together to represent a whole PropertySpecificKeyframe value. |
18 struct InterpolationValue { | 18 struct InterpolationValue { |
19 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 19 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
20 | 20 |
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(std::move(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(std::move(other.nonInterpolableValue)) {} | 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 = std::move(other.nonInterpolableValue); | 35 nonInterpolableValue = std::move(other.nonInterpolableValue); |
(...skipping 12 matching lines...) Expand all Loading... |
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 |