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

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

Issue 1414413002: SVG Web Animations: Add SVGInterpolationType pipeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_svgAttributeReference
Patch Set: Change InterpolationEnvironment 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/SampledEffect.cpp
diff --git a/third_party/WebKit/Source/core/animation/SampledEffect.cpp b/third_party/WebKit/Source/core/animation/SampledEffect.cpp
index 1115101319db686cca0596ac1bc1bc3fb5796833..0547d1a713fca0d3e2bad7ab0bcdf770ed8be1d1 100644
--- a/third_party/WebKit/Source/core/animation/SampledEffect.cpp
+++ b/third_party/WebKit/Source/core/animation/SampledEffect.cpp
@@ -5,8 +5,9 @@
#include "config.h"
#include "core/animation/SampledEffect.h"
+#include "core/animation/InterpolationEnvironment.h"
+#include "core/animation/InvalidatableInterpolation.h"
#include "core/animation/SVGInterpolation.h"
-#include "core/animation/StyleInterpolation.h"
#include "core/svg/SVGElement.h"
namespace blink {
@@ -37,6 +38,15 @@ void SampledEffect::applySVGUpdate(SVGElement& targetElement)
for (const auto& interpolation : m_interpolations) {
if (interpolation->isSVGInterpolation()) {
toSVGInterpolation(interpolation.get())->apply(targetElement);
+ } else if (interpolation->isInvalidatableInterpolation()) {
+ const InvalidatableInterpolation& invalidatableInterpolation = toInvalidatableInterpolation(*interpolation);
+ if (invalidatableInterpolation.property().isSVGAttribute()) {
+ const SVGPropertyBase& valueBase = *targetElement.propertyFromAttribute(invalidatableInterpolation.property().svgAttribute())->currentValueBase();
+ InterpolationEnvironment environment(targetElement, valueBase);
+ ActiveInterpolations activeInterpolations(1);
+ activeInterpolations[0] = interpolation.get();
+ InvalidatableInterpolation::applyStack(activeInterpolations, environment);
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698