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

Side by Side Diff: third_party/WebKit/Source/core/animation/SampledEffect.cpp

Issue 1420553004: SVG Web Animations: Add compositing pipeline for SVGInterpolationTypes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_svgValueInterpolationType
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/animation/SampledEffect.h" 6 #include "core/animation/SampledEffect.h"
7 7
8 #include "core/animation/InterpolationEnvironment.h" 8 #include "core/animation/InterpolationEnvironment.h"
9 #include "core/animation/InvalidatableInterpolation.h" 9 #include "core/animation/InvalidatableInterpolation.h"
10 #include "core/animation/SVGInterpolation.h" 10 #include "core/animation/SVGInterpolation.h"
(...skipping 15 matching lines...) Expand all
26 m_animation = nullptr; 26 m_animation = nullptr;
27 m_interpolations.clear(); 27 m_interpolations.clear();
28 } 28 }
29 29
30 DEFINE_TRACE(SampledEffect) 30 DEFINE_TRACE(SampledEffect)
31 { 31 {
32 visitor->trace(m_effect); 32 visitor->trace(m_effect);
33 visitor->trace(m_animation); 33 visitor->trace(m_animation);
34 } 34 }
35 35
36 void SampledEffect::applySVGUpdate(SVGElement& targetElement)
37 {
38 for (const auto& interpolation : m_interpolations) {
39 if (interpolation->isSVGInterpolation()) {
40 toSVGInterpolation(interpolation.get())->apply(targetElement);
41 } else if (interpolation->isInvalidatableInterpolation()) {
42 const InvalidatableInterpolation& invalidatableInterpolation = toInv alidatableInterpolation(*interpolation);
43 if (invalidatableInterpolation.property().isSVGAttribute()) {
44 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> propertyBase = targe tElement.propertyFromAttribute(invalidatableInterpolation.property().svgAttribut e());
45 InterpolationEnvironment environment(targetElement, *propertyBas e);
46 ActiveInterpolations activeInterpolations(1);
47 activeInterpolations[0] = interpolation.get();
48 InvalidatableInterpolation::applyStack(activeInterpolations, env ironment);
49 }
50 }
51 }
52 }
53
54 } // namespace blink 36 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698