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