Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: Source/core/animation/AnimationValue.h

Issue 1153943003: Add foundation for removing AnimatableValues from StyleInterpolation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review changes Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/animation/AnimationType.h ('k') | Source/core/animation/CSSValueAnimationType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9b13bce22c12aad5c2e106e222696acd6a8d2657
--- /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 copyFrom(const AnimationValue& other)
+ {
+ 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
« no previous file with comments | « Source/core/animation/AnimationType.h ('k') | Source/core/animation/CSSValueAnimationType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698