Chromium Code Reviews| Index: Source/core/animation/AnimationValue.h |
| diff --git a/Source/core/animation/AnimationValue.h b/Source/core/animation/AnimationValue.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e736e5e2c572aedca0a482f6fc05b766fa2a18e2 |
| --- /dev/null |
| +++ b/Source/core/animation/AnimationValue.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef AnimationValue_h |
| +#define AnimationValue_h |
| + |
| +#include "core/animation/InterpolableValue.h" |
| +#include "core/animation/NonInterpolableValue.h" |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class AnimationType; |
| + |
| +struct AnimationValue { |
| +private: |
| + DISALLOW_ALLOCATION(); |
| + |
| +public: |
| + const AnimationType* type; |
| + OwnPtrWillBeMember<InterpolableValue> interpolableValue; |
| + RefPtrWillBeMember<NonInterpolableValue> nonInterpolableValue; |
| + |
| + operator bool() const { return bool(type); } |
| + |
| + AnimationValue() |
| + : type(nullptr) |
| + , interpolableValue(nullptr) |
| + , nonInterpolableValue(nullptr) |
| + { } |
| + |
| + AnimationValue(const AnimationType* type, PassOwnPtrWillBeRawPtr<InterpolableValue> interpolableValue, RefPtrWillBeRawPtr<NonInterpolableValue> nonInterpolableValue) |
| + : type(type) |
| + , interpolableValue(interpolableValue) |
| + , nonInterpolableValue(nonInterpolableValue) |
| + { } |
| + |
| + void copy(const AnimationValue& other) |
|
shans
2015/06/04 00:15:15
Should this not just be a copy constructor?
alancutter (OOO until 2018)
2015/06/11 04:15:13
This is used in "result.copy((fraction < 0.5) ? m_
|
| + { |
| + type = other.type; |
| + interpolableValue = other.interpolableValue ? other.interpolableValue->clone() : nullptr; |
| + nonInterpolableValue = other.nonInterpolableValue; |
| + } |
| + |
| + void clear() |
| + { |
| + type = nullptr; |
| + interpolableValue = nullptr; |
| + nonInterpolableValue = nullptr; |
| + } |
| + |
| + DEFINE_INLINE_TRACE() |
| + { |
| + visitor->trace(interpolableValue); |
| + visitor->trace(nonInterpolableValue); |
| + } |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // AnimationValue_h |