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

Unified Diff: third_party/WebKit/Source/core/animation/SVGInterpolationEnvironment.h

Issue 2811253003: Make InterpolationEnvironment virutal (Closed)
Patch Set: protected Created 3 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: third_party/WebKit/Source/core/animation/SVGInterpolationEnvironment.h
diff --git a/third_party/WebKit/Source/core/animation/SVGInterpolationEnvironment.h b/third_party/WebKit/Source/core/animation/SVGInterpolationEnvironment.h
new file mode 100644
index 0000000000000000000000000000000000000000..e373a7d869b3cee2066eb8040db474934323c3c3
--- /dev/null
+++ b/third_party/WebKit/Source/core/animation/SVGInterpolationEnvironment.h
@@ -0,0 +1,54 @@
+// Copyright 2017 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 SVGInterpolationEnvironment_h
+#define SVGInterpolationEnvironment_h
+
+#include "core/animation/InterpolationEnvironment.h"
+#include "platform/wtf/Assertions.h"
+
+namespace blink {
+
+class SVGPropertyBase;
+class SVGElement;
+
+class SVGInterpolationEnvironment : public InterpolationEnvironment {
+ public:
+ explicit SVGInterpolationEnvironment(const InterpolationTypesMap& map,
+ SVGElement& svg_element,
+ const SVGPropertyBase& svg_base_value)
+ : InterpolationEnvironment(map),
+ svg_element_(&svg_element),
+ svg_base_value_(&svg_base_value) {}
+
+ bool IsSVG() const final { return true; }
+
+ SVGElement& SvgElement() {
+ DCHECK(svg_element_);
+ return *svg_element_;
+ }
+ const SVGElement& SvgElement() const {
+ DCHECK(svg_element_);
+ return *svg_element_;
+ }
+
+ const SVGPropertyBase& SvgBaseValue() const {
+ DCHECK(svg_base_value_);
+ return *svg_base_value_;
+ }
+
+ private:
+ Member<SVGElement> svg_element_ = nullptr;
+ Member<const SVGPropertyBase> svg_base_value_ = nullptr;
+};
+
+DEFINE_TYPE_CASTS(SVGInterpolationEnvironment,
+ InterpolationEnvironment,
+ value,
+ value->IsSVG(),
+ value.IsSVG());
+
+} // namespace blink
+
+#endif // SVGInterpolationEnvironment_h

Powered by Google App Engine
This is Rietveld 408576698