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

Unified Diff: third_party/WebKit/Source/core/animation/SVGValueInterpolationType.cpp

Issue 1414413002: SVG Web Animations: Add SVGInterpolationType pipeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_svgAttributeReference
Patch Set: Move assert to not wrong location Created 5 years, 2 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: third_party/WebKit/Source/core/animation/SVGValueInterpolationType.cpp
diff --git a/third_party/WebKit/Source/core/animation/SVGValueInterpolationType.cpp b/third_party/WebKit/Source/core/animation/SVGValueInterpolationType.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c7c37ac42f256ad3f1c3815467e8083ff3475bc7
--- /dev/null
+++ b/third_party/WebKit/Source/core/animation/SVGValueInterpolationType.cpp
@@ -0,0 +1,49 @@
+// 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.
+
+#include "config.h"
+#include "core/animation/SVGValueInterpolationType.h"
+
+#include "core/animation/InterpolationEnvironment.h"
+#include "core/animation/StringKeyframe.h"
+#include "core/svg/properties/SVGAnimatedProperty.h"
+
+namespace blink {
+
+class SVGValueNonInterpolableValue : public NonInterpolableValue {
+public:
+ virtual ~SVGValueNonInterpolableValue() {}
+
+ static PassRefPtr<SVGValueNonInterpolableValue> create(PassRefPtrWillBeRawPtr<SVGPropertyBase> svgValue)
+ {
+ return adoptRef(new SVGValueNonInterpolableValue(svgValue));
+ }
+
+ PassRefPtrWillBeRawPtr<SVGPropertyBase> svgValue() const { return m_svgValue; }
+
+ DECLARE_NON_INTERPOLABLE_VALUE_TYPE();
+
+private:
+ SVGValueNonInterpolableValue(PassRefPtrWillBeRawPtr<SVGPropertyBase> svgValue)
+ : m_svgValue(svgValue)
+ {}
+
+ RefPtrWillBePersistent<SVGPropertyBase> m_svgValue;
+};
+
+DEFINE_NON_INTERPOLABLE_VALUE_TYPE(SVGValueNonInterpolableValue);
+DEFINE_NON_INTERPOLABLE_VALUE_TYPE_CASTS(SVGValueNonInterpolableValue);
+
+PassOwnPtr<InterpolationValue> SVGValueInterpolationType::maybeConvertSVGValue(const SVGPropertyBase& value) const
+{
+ RefPtrWillBeRawPtr<SVGPropertyBase> referencedValue = const_cast<SVGPropertyBase*>(&value); // Take ref.
+ return InterpolationValue::create(*this, InterpolableList::create(0), SVGValueNonInterpolableValue::create(referencedValue.release()));
+}
+
+RefPtrWillBeRawPtr<SVGPropertyBase> SVGValueInterpolationType::appliedSVGValue(const InterpolableValue&, const NonInterpolableValue* nonInterpolableValue) const
+{
+ return toSVGValueNonInterpolableValue(*nonInterpolableValue).svgValue();
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698