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

Unified Diff: Source/core/animation/NonInterpolableValue.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
Index: Source/core/animation/NonInterpolableValue.h
diff --git a/Source/core/animation/NonInterpolableValue.h b/Source/core/animation/NonInterpolableValue.h
new file mode 100644
index 0000000000000000000000000000000000000000..7f28202993cc5a7cf7620505be7455755b383b8a
--- /dev/null
+++ b/Source/core/animation/NonInterpolableValue.h
@@ -0,0 +1,37 @@
+// 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 NonInterpolableValue_h
+#define NonInterpolableValue_h
+
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+// Holds components of a keyframe value that do not change when interpolating with another keyframe.
+class NonInterpolableValue : public RefCountedWillBeGarbageCollectedFinalized<NonInterpolableValue> {
+public:
+ virtual ~NonInterpolableValue() { }
+
+ typedef const void* Type;
+ virtual Type type() const = 0;
+
+ DEFINE_INLINE_VIRTUAL_TRACE() { }
+};
+
+// These macros provide safe downcasts of NonInterpolableValue subclasses with debug assertions.
+// See CSSValueAnimationType for example usage.
+#define DECLARE_NON_INTERPOLABLE_VALUE_TYPE() \
+ static Type staticType; \
+ virtual Type type() const { return staticType; }
+
+#define DEFINE_NON_INTERPOLABLE_VALUE_TYPE(T) \
+ NonInterpolableValue::Type T::staticType = &T::staticType;
+
+#define DEFINE_NON_INTERPOLABLE_VALUE_TYPE_CASTS(T) \
+ DEFINE_TYPE_CASTS(T, NonInterpolableValue, value, value->type() == T::staticType, value.type() == T::staticType);
+
+} // namespace blink
+
+#endif // NonInterpolableValue_h
« no previous file with comments | « Source/core/animation/InvalidatableStyleInterpolation.cpp ('k') | Source/core/animation/PrimitiveInterpolation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698