Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef AnimationValue_h | |
| 6 #define AnimationValue_h | |
| 7 | |
| 8 #include "core/animation/InterpolableValue.h" | |
| 9 #include "core/animation/NonInterpolableValue.h" | |
| 10 #include "platform/heap/Handle.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 class AnimationType; | |
| 15 | |
| 16 struct AnimationValue { | |
| 17 private: | |
| 18 DISALLOW_ALLOCATION(); | |
| 19 | |
| 20 public: | |
| 21 const AnimationType* type; | |
| 22 OwnPtrWillBeMember<InterpolableValue> interpolableValue; | |
| 23 RefPtrWillBeMember<NonInterpolableValue> nonInterpolableValue; | |
| 24 | |
| 25 operator bool() const { return bool(type); } | |
| 26 | |
| 27 AnimationValue() | |
| 28 : type(nullptr) | |
| 29 , interpolableValue(nullptr) | |
| 30 , nonInterpolableValue(nullptr) | |
| 31 { } | |
| 32 | |
| 33 AnimationValue(const AnimationType* type, PassOwnPtrWillBeRawPtr<Interpolabl eValue> interpolableValue, RefPtrWillBeRawPtr<NonInterpolableValue> nonInterpola bleValue) | |
| 34 : type(type) | |
| 35 , interpolableValue(interpolableValue) | |
| 36 , nonInterpolableValue(nonInterpolableValue) | |
| 37 { } | |
| 38 | |
| 39 void copy(const AnimationValue& other) | |
|
dstockwell
2015/06/23 06:49:46
copyFrom?
Why is this not a copy-constructor?
alancutter (OOO until 2018)
2015/06/23 08:11:04
Changed to copyFrom(). If this were a copy-constru
| |
| 40 { | |
| 41 type = other.type; | |
| 42 interpolableValue = other.interpolableValue ? other.interpolableValue->c lone() : nullptr; | |
| 43 nonInterpolableValue = other.nonInterpolableValue; | |
| 44 } | |
| 45 | |
| 46 void clear() | |
| 47 { | |
| 48 type = nullptr; | |
| 49 interpolableValue = nullptr; | |
| 50 nonInterpolableValue = nullptr; | |
| 51 } | |
| 52 | |
| 53 DEFINE_INLINE_TRACE() | |
| 54 { | |
| 55 visitor->trace(interpolableValue); | |
| 56 visitor->trace(nonInterpolableValue); | |
| 57 } | |
| 58 }; | |
| 59 | |
| 60 } // namespace blink | |
| 61 | |
| 62 #endif // AnimationValue_h | |
| OLD | NEW |