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 PairwiseInterpolationValue_h | 5 #ifndef PairwiseInterpolationValue_h |
6 #define PairwiseInterpolationValue_h | 6 #define PairwiseInterpolationValue_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> | |
12 | 11 |
13 namespace blink { | 12 namespace blink { |
14 | 13 |
15 // Represents the smooth interpolation between an adjacent pair of PropertySpeci
ficKeyframes. | 14 // Represents the smooth interpolation between an adjacent pair of PropertySpeci
ficKeyframes. |
16 struct PairwiseInterpolationValue { | 15 struct PairwiseInterpolationValue { |
17 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 16 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
18 | 17 |
19 PairwiseInterpolationValue(std::unique_ptr<InterpolableValue> startInterpola
bleValue, std::unique_ptr<InterpolableValue> endInterpolableValue, PassRefPtr<No
nInterpolableValue> nonInterpolableValue = nullptr) | 18 PairwiseInterpolationValue(PassOwnPtr<InterpolableValue> startInterpolableVa
lue, PassOwnPtr<InterpolableValue> endInterpolableValue, PassRefPtr<NonInterpola
bleValue> nonInterpolableValue = nullptr) |
20 : startInterpolableValue(std::move(startInterpolableValue)) | 19 : startInterpolableValue(std::move(startInterpolableValue)) |
21 , endInterpolableValue(std::move(endInterpolableValue)) | 20 , endInterpolableValue(std::move(endInterpolableValue)) |
22 , nonInterpolableValue(std::move(nonInterpolableValue)) | 21 , nonInterpolableValue(std::move(nonInterpolableValue)) |
23 { } | 22 { } |
24 | 23 |
25 PairwiseInterpolationValue(std::nullptr_t) { } | 24 PairwiseInterpolationValue(std::nullptr_t) { } |
26 | 25 |
27 PairwiseInterpolationValue(PairwiseInterpolationValue&& other) | 26 PairwiseInterpolationValue(PairwiseInterpolationValue&& other) |
28 : startInterpolableValue(std::move(other.startInterpolableValue)) | 27 : startInterpolableValue(std::move(other.startInterpolableValue)) |
29 , endInterpolableValue(std::move(other.endInterpolableValue)) | 28 , endInterpolableValue(std::move(other.endInterpolableValue)) |
30 , nonInterpolableValue(other.nonInterpolableValue.release()) | 29 , nonInterpolableValue(other.nonInterpolableValue.release()) |
31 { } | 30 { } |
32 | 31 |
33 operator bool() const { return startInterpolableValue.get(); } | 32 operator bool() const { return startInterpolableValue.get(); } |
34 | 33 |
35 std::unique_ptr<InterpolableValue> startInterpolableValue; | 34 OwnPtr<InterpolableValue> startInterpolableValue; |
36 std::unique_ptr<InterpolableValue> endInterpolableValue; | 35 OwnPtr<InterpolableValue> endInterpolableValue; |
37 RefPtr<NonInterpolableValue> nonInterpolableValue; | 36 RefPtr<NonInterpolableValue> nonInterpolableValue; |
38 }; | 37 }; |
39 | 38 |
40 } // namespace blink | 39 } // namespace blink |
41 | 40 |
42 #endif // PairwiseInterpolationValue_h | 41 #endif // PairwiseInterpolationValue_h |
OLD | NEW |