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

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: 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..cf9561887eec35ccbcc9a178a6f44fd727f45ba7
--- /dev/null
+++ b/Source/core/animation/LegacyStyleInterpolation.h
@@ -0,0 +1,57 @@
+// 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/InterpolableValuePromise.h"
+#include "core/animation/Interpolation.h"
+
+namespace WebCore {
+
+class LegacyStyleInterpolation : public StyleInterpolation {
+public:
+ static PassRefPtrWillBeRawPtr<LegacyStyleInterpolation> create(PassRefPtrWillBeRawPtr<InterpolableValuePromise> start, PassRefPtrWillBeRawPtr<InterpolableValuePromise> end, CSSPropertyID);
+
+ static PassRefPtrWillBeRawPtr<LegacyStyleInterpolation> create(PassRefPtrWillBeRawPtr<AnimatableValue> start, PassRefPtrWillBeRawPtr<AnimatableValue> end, CSSPropertyID id)
+ {
+ return adoptRefWillBeNoop(new LegacyStyleInterpolation(InterpolableAnimatableValue::create(start), InterpolableAnimatableValue::create(end), id));
+ }
+
+ virtual void apply(StyleResolverState&) const OVERRIDE;
+
+ virtual bool isLegacyStyleInterpolation() const OVERRIDE FINAL { return true; }
+
+ PassRefPtrWillBeRawPtr<AnimatableValue> currentValue() const
+ {
+ InterpolableAnimatableValue* value = static_cast<InterpolableAnimatableValue*>(m_cachedValue.get());
+ return value ? value->value() : 0;
+ }
+
+ virtual void trace(Visitor*) OVERRIDE;
+
+private:
+ LegacyStyleInterpolation(PassRefPtrWillBeRawPtr<InterpolableValuePromise> start, PassRefPtrWillBeRawPtr<InterpolableValuePromise> end, CSSPropertyID id)
+ : StyleInterpolation(nullptr, nullptr, id)
+ , m_startPromise(start)
+ , m_endPromise(end)
+ {
+ }
+
+ LegacyStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> startValue, PassOwnPtrWillBeRawPtr<InterpolableValue> endValue, CSSPropertyID id)
+ : StyleInterpolation(startValue, endValue, id)
+ , m_startPromise(nullptr)
+ , m_endPromise(nullptr)
+ {
+ }
+
+ const RefPtrWillBeMember<InterpolableValuePromise> m_startPromise;
+ const RefPtrWillBeMember<InterpolableValuePromise> m_endPromise;
+};
+
+DEFINE_TYPE_CASTS(LegacyStyleInterpolation, Interpolation, value, value->isLegacyStyleInterpolation(), value.isLegacyStyleInterpolation());
+
+}
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698