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

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: Rebased 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
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return m_resources.get(id); 92 return m_resources.get(id);
93 } 93 }
94 94
95 void SVGDocumentExtensions::serviceOnAnimationFrame(Document& document, double m onotonicAnimationStartTime) 95 void SVGDocumentExtensions::serviceOnAnimationFrame(Document& document, double m onotonicAnimationStartTime)
96 { 96 {
97 if (!document.svgExtensions()) 97 if (!document.svgExtensions())
98 return; 98 return;
99 document.accessSVGExtensions().serviceAnimations(monotonicAnimationStartTime ); 99 document.accessSVGExtensions().serviceAnimations(monotonicAnimationStartTime );
100 } 100 }
101 101
102 static bool isSVGAttributeHandle(const PropertyHandle& propertyHandle)
103 {
104 return propertyHandle.isSVGAttribute();
105 }
106
102 void SVGDocumentExtensions::serviceAnimations(double monotonicAnimationStartTime ) 107 void SVGDocumentExtensions::serviceAnimations(double monotonicAnimationStartTime )
103 { 108 {
104 if (RuntimeEnabledFeatures::smilEnabled()) { 109 if (RuntimeEnabledFeatures::smilEnabled()) {
105 WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement>> timeContainers; 110 WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement>> timeContainers;
106 copyToVector(m_timeContainers, timeContainers); 111 copyToVector(m_timeContainers, timeContainers);
107 for (const auto& container : timeContainers) 112 for (const auto& container : timeContainers)
108 container->timeContainer()->serviceAnimations(monotonicAnimationStar tTime); 113 container->timeContainer()->serviceAnimations(monotonicAnimationStar tTime);
109 } 114 }
110 115
111 SVGElementSet webAnimationsPendingSVGElements; 116 SVGElementSet webAnimationsPendingSVGElements;
112 webAnimationsPendingSVGElements.swap(m_webAnimationsPendingSVGElements); 117 webAnimationsPendingSVGElements.swap(m_webAnimationsPendingSVGElements);
113 118
114 // 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. 119 // 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 for (auto& svgElement : webAnimationsPendingSVGElements) { 120 for (auto& svgElement : webAnimationsPendingSVGElements) {
116 ActiveInterpolationsMap activeInterpolationsMap = AnimationStack::active Interpolations( 121 ActiveInterpolationsMap activeInterpolationsMap = AnimationStack::active Interpolations(
117 &svgElement->elementAnimations()->animationStack(), nullptr, nullptr , KeyframeEffect::DefaultPriority); 122 &svgElement->elementAnimations()->animationStack(), nullptr, nullptr , KeyframeEffect::DefaultPriority, isSVGAttributeHandle);
118 for (auto& entry : activeInterpolationsMap) { 123 for (auto& entry : activeInterpolationsMap) {
119 if (!entry.key.isSVGAttribute())
120 continue;
121 const QualifiedName& attribute = entry.key.svgAttribute(); 124 const QualifiedName& attribute = entry.key.svgAttribute();
122 const Interpolation& interpolation = *entry.value.first(); 125 const Interpolation& interpolation = *entry.value.first();
123 if (interpolation.isInvalidatableInterpolation()) { 126 if (interpolation.isInvalidatableInterpolation()) {
124 InterpolationEnvironment environment(*svgElement, svgElement->pr opertyFromAttribute(attribute)->baseValueBase()); 127 InterpolationEnvironment environment(*svgElement, svgElement->pr opertyFromAttribute(attribute)->baseValueBase());
125 InvalidatableInterpolation::applyStack(entry.value, environment) ; 128 InvalidatableInterpolation::applyStack(entry.value, environment) ;
126 } else { 129 } else {
127 // TODO(alancutter): Remove this old code path once animations h ave completely migrated to InterpolationTypes. 130 // TODO(alancutter): Remove this old code path once animations h ave completely migrated to InterpolationTypes.
128 toSVGInterpolation(interpolation).apply(*svgElement); 131 toSVGInterpolation(interpolation).apply(*svgElement);
129 } 132 }
130 } 133 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 visitor->trace(m_document); 397 visitor->trace(m_document);
395 visitor->trace(m_timeContainers); 398 visitor->trace(m_timeContainers);
396 visitor->trace(m_webAnimationsPendingSVGElements); 399 visitor->trace(m_webAnimationsPendingSVGElements);
397 visitor->trace(m_relativeLengthSVGRoots); 400 visitor->trace(m_relativeLengthSVGRoots);
398 visitor->trace(m_pendingResources); 401 visitor->trace(m_pendingResources);
399 visitor->trace(m_pendingResourcesForRemoval); 402 visitor->trace(m_pendingResourcesForRemoval);
400 #endif 403 #endif
401 } 404 }
402 405
403 } 406 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698