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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp

Issue 1412423004: Web Animations: Move property handle filtering into AnimationStack building (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_svgAdditiveApplication
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 /* 1 /*
2 * Copyright (C) 2006 Apple Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Rob Buis <buis@kde.org> 4 * Copyright (C) 2007 Rob Buis <buis@kde.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 return m_resources.get(id); 91 return m_resources.get(id);
92 } 92 }
93 93
94 void SVGDocumentExtensions::serviceOnAnimationFrame(Document& document, double m onotonicAnimationStartTime) 94 void SVGDocumentExtensions::serviceOnAnimationFrame(Document& document, double m onotonicAnimationStartTime)
95 { 95 {
96 if (!document.svgExtensions()) 96 if (!document.svgExtensions())
97 return; 97 return;
98 document.accessSVGExtensions().serviceAnimations(monotonicAnimationStartTime ); 98 document.accessSVGExtensions().serviceAnimations(monotonicAnimationStartTime );
99 } 99 }
100 100
101 static bool isSVGAttributeHandle(const PropertyHandle& propertyHandle)
102 {
103 return propertyHandle.isSVGAttribute();
104 }
105
101 void SVGDocumentExtensions::serviceAnimations(double monotonicAnimationStartTime ) 106 void SVGDocumentExtensions::serviceAnimations(double monotonicAnimationStartTime )
102 { 107 {
103 if (RuntimeEnabledFeatures::smilEnabled()) { 108 if (RuntimeEnabledFeatures::smilEnabled()) {
104 WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement>> timeContainers; 109 WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement>> timeContainers;
105 copyToVector(m_timeContainers, timeContainers); 110 copyToVector(m_timeContainers, timeContainers);
106 for (const auto& container : timeContainers) 111 for (const auto& container : timeContainers)
107 container->timeContainer()->serviceAnimations(monotonicAnimationStar tTime); 112 container->timeContainer()->serviceAnimations(monotonicAnimationStar tTime);
108 } 113 }
109 114
110 // TODO(alancutter): Make SVG animation effect application a separate docume nt lifecycle phase from servicing animations to be responsive to Javascript mani pulation of exposed animation objects. 115 // TODO(alancutter): Make SVG animation effect application a separate docume nt lifecycle phase from servicing animations to be responsive to Javascript mani pulation of exposed animation objects.
111 for (auto& svgElement : m_webAnimatedSVGElements) { 116 for (auto& svgElement : m_webAnimatedSVGElements) {
112 ActiveInterpolationsMap activeInterpolationsMap = AnimationStack::active Interpolations(&svgElement->elementAnimations()->animationStack(), nullptr, null ptr, KeyframeEffect::DefaultPriority, 0); 117 ActiveInterpolationsMap activeInterpolationsMap = AnimationStack::active Interpolations(&svgElement->elementAnimations()->animationStack(), nullptr, null ptr, KeyframeEffect::DefaultPriority, 0, isSVGAttributeHandle);
113 for (auto& entry : activeInterpolationsMap) { 118 for (auto& entry : activeInterpolationsMap) {
114 if (!entry.key.isSVGAttribute())
115 continue;
116 const QualifiedName& attribute = entry.key.svgAttribute(); 119 const QualifiedName& attribute = entry.key.svgAttribute();
117 const Interpolation& interpolation = *entry.value.first(); 120 const Interpolation& interpolation = *entry.value.first();
118 if (interpolation.isInvalidatableInterpolation()) { 121 if (interpolation.isInvalidatableInterpolation()) {
119 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> propertyBase = svgEl ement->propertyFromAttribute(attribute); 122 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> propertyBase = svgEl ement->propertyFromAttribute(attribute);
120 InterpolationEnvironment environment(*svgElement, *propertyBase) ; 123 InterpolationEnvironment environment(*svgElement, *propertyBase) ;
121 InvalidatableInterpolation::applyStack(entry.value, environment) ; 124 InvalidatableInterpolation::applyStack(entry.value, environment) ;
122 } else { 125 } else {
123 // TODO(alancutter): Remove this old code path once animations h ave completely migrated to InterpolationTypes. 126 // TODO(alancutter): Remove this old code path once animations h ave completely migrated to InterpolationTypes.
124 toSVGInterpolation(interpolation).apply(*svgElement); 127 toSVGInterpolation(interpolation).apply(*svgElement);
125 } 128 }
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 #if ENABLE(OILPAN) 391 #if ENABLE(OILPAN)
389 visitor->trace(m_document); 392 visitor->trace(m_document);
390 visitor->trace(m_timeContainers); 393 visitor->trace(m_timeContainers);
391 visitor->trace(m_relativeLengthSVGRoots); 394 visitor->trace(m_relativeLengthSVGRoots);
392 visitor->trace(m_pendingResources); 395 visitor->trace(m_pendingResources);
393 visitor->trace(m_pendingResourcesForRemoval); 396 visitor->trace(m_pendingResourcesForRemoval);
394 #endif 397 #endif
395 } 398 }
396 399
397 } 400 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698