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

Side by Side 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: Move assert to not wrong location Created 5 years, 1 month 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"
9 #include "core/animation/InvalidatableInterpolation.h"
8 #include "core/animation/SVGInterpolation.h" 10 #include "core/animation/SVGInterpolation.h"
9 #include "core/animation/StyleInterpolation.h"
10 #include "core/svg/SVGElement.h" 11 #include "core/svg/SVGElement.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 SampledEffect::SampledEffect(KeyframeEffect* effect) 15 SampledEffect::SampledEffect(KeyframeEffect* effect)
15 : m_effect(effect) 16 : m_effect(effect)
16 , m_animation(effect->animation()) 17 , m_animation(effect->animation())
17 , m_sequenceNumber(effect->animation()->sequenceNumber()) 18 , m_sequenceNumber(effect->animation()->sequenceNumber())
18 , m_priority(effect->priority()) 19 , m_priority(effect->priority())
19 { 20 {
(...skipping 10 matching lines...) Expand all
30 { 31 {
31 visitor->trace(m_effect); 32 visitor->trace(m_effect);
32 visitor->trace(m_animation); 33 visitor->trace(m_animation);
33 } 34 }
34 35
35 void SampledEffect::applySVGUpdate(SVGElement& targetElement) 36 void SampledEffect::applySVGUpdate(SVGElement& targetElement)
36 { 37 {
37 for (const auto& interpolation : m_interpolations) { 38 for (const auto& interpolation : m_interpolations) {
38 if (interpolation->isSVGInterpolation()) { 39 if (interpolation->isSVGInterpolation()) {
39 toSVGInterpolation(interpolation.get())->apply(targetElement); 40 toSVGInterpolation(interpolation.get())->apply(targetElement);
41 } else if (interpolation->isInvalidatableInterpolation()) {
42 const InvalidatableInterpolation& invalidatableInterpolation = toInv alidatableInterpolation(*interpolation);
43 if (invalidatableInterpolation.property().isSVGAttribute()) {
44 const SVGPropertyBase& baseValue = targetElement.propertyFromAtt ribute(invalidatableInterpolation.property().svgAttribute())->baseValueBase();
45 InterpolationEnvironment environment(targetElement, baseValue);
46 ActiveInterpolations activeInterpolations(1);
47 activeInterpolations[0] = interpolation.get();
48 InvalidatableInterpolation::applyStack(activeInterpolations, env ironment);
49 }
40 } 50 }
41 } 51 }
42 } 52 }
43 53
44 } // namespace blink 54 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698