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

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

Issue 273683005: Web Animations API: Deferred computation of interpolated values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing test file Created 6 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/LegacyStyleInterpolation.h
diff --git a/Source/core/animation/LegacyStyleInterpolation.h b/Source/core/animation/LegacyStyleInterpolation.h
new file mode 100644
index 0000000000000000000000000000000000000000..9ce5c8d419a606d5cfcc40971fe9a17d9bb04501
--- /dev/null
+++ b/Source/core/animation/LegacyStyleInterpolation.h
@@ -0,0 +1,63 @@
+// Copyright 2014 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 LegacyStyleInterpolation_h
+#define LegacyStyleInterpolation_h
+
+#include "core/animation/Interpolation.h"
+
+namespace WebCore {
+
+class CSSPrimitiveValue;
+class Element;
+
+class LegacyStyleInterpolation : public StyleInterpolation {
+public:
+ static PassRefPtrWillBeRawPtr<LegacyStyleInterpolation> create(CSSValue& start, CSSValue& end, CSSPropertyID, Element&);
+ static PassRefPtrWillBeRawPtr<LegacyStyleInterpolation> create(PassOwnPtrWillBeRawPtr<InterpolableAnimatableValue> start, PassOwnPtrWillBeRawPtr<InterpolableAnimatableValue> end, CSSPropertyID id)
+ {
+ return adoptRefWillBeNoop(new LegacyStyleInterpolation(start, end, id));
+ }
+
+ virtual void apply(StyleResolverState&) const OVERRIDE;
+
+ virtual bool isLegacyStyleInterpolation() const OVERRIDE FINAL { return true; }
+
+ PassRefPtrWillBeRawPtr<AnimatableValue> currentValue() const
+ {
+ if (m_interpolationRequiresStyleResolve)
+ return nullptr;
+ return toInterpolableAnimatableValue(*m_cachedValue).value();
+ }
+
+ static bool interpolationRequiresStyleResolve(const CSSValue&);
+ static bool interpolationRequiresStyleResolve(const CSSPrimitiveValue&);
+
+ virtual void trace(Visitor*) OVERRIDE;
+
+private:
+ LegacyStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableAnimatableValue> start, PassOwnPtrWillBeRawPtr<InterpolableAnimatableValue> end, CSSPropertyID id)
+ : StyleInterpolation(start, end, id)
+ , m_interpolationRequiresStyleResolve(false)
+ {
+ }
+
+ LegacyStyleInterpolation(PassRefPtrWillBeRawPtr<CSSValue> start, PassRefPtrWillBeRawPtr<CSSValue> end, CSSPropertyID id)
+ : StyleInterpolation(InterpolableNumber::create(0), InterpolableNumber::create(1), id)
+ , m_interpolationRequiresStyleResolve(true)
+ , m_startCSSValue(start)
+ , m_endCSSValue(end)
+ {
+ }
+
+ const bool m_interpolationRequiresStyleResolve;
+ const RefPtrWillBeMember<CSSValue> m_startCSSValue;
+ const RefPtrWillBeMember<CSSValue> m_endCSSValue;
+};
+
+DEFINE_TYPE_CASTS(LegacyStyleInterpolation, Interpolation, value, value->isLegacyStyleInterpolation(), value.isLegacyStyleInterpolation());
+
+}
+
+#endif
« no previous file with comments | « Source/core/animation/KeyframeEffectModelTest.cpp ('k') | Source/core/animation/LegacyStyleInterpolation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698