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 InterpolationComponent_h | 5 #ifndef InterpolationComponent_h |
6 #define InterpolationComponent_h | 6 #define InterpolationComponent_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 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 struct InterpolationComponent { | 14 struct InterpolationComponent { |
15 ALLOW_ONLY_INLINE_ALLOCATION(); | 15 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
16 | 16 |
17 explicit InterpolationComponent(PassOwnPtr<InterpolableValue> interpolableVa
lue, PassRefPtr<NonInterpolableValue> nonInterpolableValue = nullptr) | 17 explicit InterpolationComponent(PassOwnPtr<InterpolableValue> interpolableVa
lue, PassRefPtr<NonInterpolableValue> nonInterpolableValue = nullptr) |
18 : interpolableValue(interpolableValue) | 18 : interpolableValue(interpolableValue) |
19 , nonInterpolableValue(nonInterpolableValue) | 19 , nonInterpolableValue(nonInterpolableValue) |
20 { } | 20 { } |
21 | 21 |
22 InterpolationComponent(const void* null) { ASSERT(null == 0); } | 22 InterpolationComponent(const void* null) { ASSERT(null == 0); } |
23 | 23 |
24 InterpolationComponent(InterpolationComponent&& other) | 24 InterpolationComponent(InterpolationComponent&& other) |
25 : interpolableValue(other.interpolableValue.release()) | 25 : interpolableValue(other.interpolableValue.release()) |
26 , nonInterpolableValue(other.nonInterpolableValue.release()) | 26 , nonInterpolableValue(other.nonInterpolableValue.release()) |
27 { } | 27 { } |
28 | 28 |
29 operator bool() const { return interpolableValue; } | 29 operator bool() const { return interpolableValue; } |
30 | 30 |
31 OwnPtr<InterpolableValue> interpolableValue; | 31 OwnPtr<InterpolableValue> interpolableValue; |
32 RefPtr<NonInterpolableValue> nonInterpolableValue; | 32 RefPtr<NonInterpolableValue> nonInterpolableValue; |
33 }; | 33 }; |
34 | 34 |
35 struct PairwiseInterpolationComponent { | 35 struct PairwiseInterpolationComponent { |
36 ALLOW_ONLY_INLINE_ALLOCATION(); | 36 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
37 | 37 |
38 PairwiseInterpolationComponent(PassOwnPtr<InterpolableValue> startInterpolab
leValue, PassOwnPtr<InterpolableValue> endInterpolableValue, PassRefPtr<NonInter
polableValue> nonInterpolableValue = nullptr) | 38 PairwiseInterpolationComponent(PassOwnPtr<InterpolableValue> startInterpolab
leValue, PassOwnPtr<InterpolableValue> endInterpolableValue, PassRefPtr<NonInter
polableValue> nonInterpolableValue = nullptr) |
39 : startInterpolableValue(startInterpolableValue) | 39 : startInterpolableValue(startInterpolableValue) |
40 , endInterpolableValue(endInterpolableValue) | 40 , endInterpolableValue(endInterpolableValue) |
41 , nonInterpolableValue(nonInterpolableValue) | 41 , nonInterpolableValue(nonInterpolableValue) |
42 { } | 42 { } |
43 | 43 |
44 PairwiseInterpolationComponent(const void* null) { ASSERT(null == 0); } | 44 PairwiseInterpolationComponent(const void* null) { ASSERT(null == 0); } |
45 | 45 |
46 PairwiseInterpolationComponent(PairwiseInterpolationComponent&& other) | 46 PairwiseInterpolationComponent(PairwiseInterpolationComponent&& other) |
47 : startInterpolableValue(other.startInterpolableValue.release()) | 47 : startInterpolableValue(other.startInterpolableValue.release()) |
48 , endInterpolableValue(other.endInterpolableValue.release()) | 48 , endInterpolableValue(other.endInterpolableValue.release()) |
49 , nonInterpolableValue(other.nonInterpolableValue.release()) | 49 , nonInterpolableValue(other.nonInterpolableValue.release()) |
50 { } | 50 { } |
51 | 51 |
52 operator bool() const { return startInterpolableValue; } | 52 operator bool() const { return startInterpolableValue; } |
53 | 53 |
54 OwnPtr<InterpolableValue> startInterpolableValue; | 54 OwnPtr<InterpolableValue> startInterpolableValue; |
55 OwnPtr<InterpolableValue> endInterpolableValue; | 55 OwnPtr<InterpolableValue> endInterpolableValue; |
56 RefPtr<NonInterpolableValue> nonInterpolableValue; | 56 RefPtr<NonInterpolableValue> nonInterpolableValue; |
57 }; | 57 }; |
58 | 58 |
59 } // namespace blink | 59 } // namespace blink |
60 | 60 |
61 #endif // InterpolationComponent_h | 61 #endif // InterpolationComponent_h |
OLD | NEW |