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

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

Issue 1153943003: Add foundation for removing AnimatableValues from StyleInterpolation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing header file Created 5 years, 7 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/DefaultAnimationType.h
diff --git a/Source/core/animation/DefaultAnimationType.h b/Source/core/animation/DefaultAnimationType.h
new file mode 100644
index 0000000000000000000000000000000000000000..732d2cb4d3f9cac4cf501ae7e4e8a1826506600a
--- /dev/null
+++ b/Source/core/animation/DefaultAnimationType.h
@@ -0,0 +1,59 @@
+// 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 DefaultAnimationType_h
+#define DefaultAnimationType_h
+
+#include "core/animation/AnimationType.h"
+
+namespace blink {
+
+class DefaultAnimationType : public AnimationType {
+public:
+ DefaultAnimationType(CSSPropertyID property)
+ : m_property(property)
+ { }
+
+ virtual CSSPropertyID property() const { return m_property; }
+
+ virtual bool maybeConvertSingle(
+ const CSSPropertySpecificKeyframe&,
+ const StyleResolverState*,
+ RefPtrWillBeRawPtr<InterpolationInvalidators>& resultInvalidators,
+ OwnPtrWillBeRawPtr<InterpolableValue>& resultInterpolableValue,
+ RefPtrWillBeRawPtr<NonInterpolableValue>& resultNonInterpolableValue) const;
+
+ virtual void apply(const InterpolableValue&, const NonInterpolableValue*, StyleResolverState&) const;
+private:
+ const CSSPropertyID m_property;
+};
+
+class DefaultNonInterpolableValue : public NonInterpolableValue {
+public:
+ static PassRefPtrWillBeRawPtr<DefaultNonInterpolableValue> create(PassRefPtrWillBeRawPtr<CSSValue> cssValue)
+ {
+ return adoptRefWillBeNoop(new DefaultNonInterpolableValue(cssValue));
+ }
+
+ CSSValue* cssValue() const { return m_cssValue.get(); }
+
+ DEFINE_INLINE_VIRTUAL_TRACE()
+ {
+ NonInterpolableValue::trace(visitor);
+ visitor->trace(m_cssValue);
+ }
+ DECLARE_NON_INTERPOLABLE_VALUE_TYPE();
+private:
+ DefaultNonInterpolableValue(PassRefPtrWillBeRawPtr<CSSValue> cssValue)
+ : m_cssValue(cssValue)
+ { }
+
+ RefPtrWillBeMember<CSSValue> m_cssValue;
+};
+
+DEFINE_NON_INTERPOLABLE_VALUE_TYPE_CASTS(DefaultNonInterpolableValue);
+
+} // namespace blink
+
+#endif // DefaultAnimationType_h

Powered by Google App Engine
This is Rietveld 408576698