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

Unified Diff: third_party/WebKit/Source/core/animation/AnimationStack.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, 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/AnimationStack.cpp
diff --git a/third_party/WebKit/Source/core/animation/AnimationStack.cpp b/third_party/WebKit/Source/core/animation/AnimationStack.cpp
index 8220f482897436095bd333bf58f92b6cec247458..581f3da5d5c79444cec40cfdcfce080c1728e394 100644
--- a/third_party/WebKit/Source/core/animation/AnimationStack.cpp
+++ b/third_party/WebKit/Source/core/animation/AnimationStack.cpp
@@ -43,9 +43,11 @@ namespace blink {
namespace {
-void copyToActiveInterpolationsMap(const Vector<RefPtr<Interpolation>>& source, ActiveInterpolationsMap& target)
+void copyToActiveInterpolationsMap(const Vector<RefPtr<Interpolation>>& source, AnimationStack::PropertyHandleFilter propertyHandleFilter, ActiveInterpolationsMap& target)
{
for (const auto& interpolation : source) {
+ if (propertyHandleFilter && !propertyHandleFilter(interpolation->property()))
+ continue;
ActiveInterpolationsMap::AddResult entry = target.add(interpolation->property(), ActiveInterpolations(1));
ActiveInterpolations& activeInterpolations = entry.storedValue->value;
if (!entry.isNewEntry
@@ -65,13 +67,13 @@ bool compareEffects(const Member<SampledEffect>& effect1, const Member<SampledEf
return effect1->sequenceNumber() < effect2->sequenceNumber();
}
-void copyNewAnimationsToActiveInterpolationsMap(const HeapVector<Member<InertEffect>>& newAnimations, ActiveInterpolationsMap& result)
+void copyNewAnimationsToActiveInterpolationsMap(const HeapVector<Member<InertEffect>>& newAnimations, AnimationStack::PropertyHandleFilter propertyHandleFilter, ActiveInterpolationsMap& result)
{
for (const auto& newAnimation : newAnimations) {
Vector<RefPtr<Interpolation>> sample;
newAnimation->sample(sample);
if (!sample.isEmpty())
- copyToActiveInterpolationsMap(sample, result);
+ copyToActiveInterpolationsMap(sample, propertyHandleFilter, result);
}
}
@@ -91,7 +93,7 @@ bool AnimationStack::hasActiveAnimationsOnCompositor(CSSPropertyID property) con
return false;
}
-ActiveInterpolationsMap AnimationStack::activeInterpolations(AnimationStack* animationStack, const HeapVector<Member<InertEffect>>* newAnimations, const HeapHashSet<Member<const Animation>>* suppressedAnimations, KeyframeEffect::Priority priority)
+ActiveInterpolationsMap AnimationStack::activeInterpolations(AnimationStack* animationStack, const HeapVector<Member<InertEffect>>* newAnimations, const HeapHashSet<Member<const Animation>>* suppressedAnimations, KeyframeEffect::Priority priority, PropertyHandleFilter propertyHandleFilter)
{
ActiveInterpolationsMap result;
@@ -103,12 +105,12 @@ ActiveInterpolationsMap AnimationStack::activeInterpolations(AnimationStack* ani
for (const auto& effect : effects) {
if (effect->priority() != priority || (suppressedAnimations && effect->effect() && suppressedAnimations->contains(effect->effect()->animation())))
continue;
- copyToActiveInterpolationsMap(effect->interpolations(), result);
+ copyToActiveInterpolationsMap(effect->interpolations(), propertyHandleFilter, result);
}
}
if (newAnimations)
- copyNewAnimationsToActiveInterpolationsMap(*newAnimations, result);
+ copyNewAnimationsToActiveInterpolationsMap(*newAnimations, propertyHandleFilter, result);
return result;
}

Powered by Google App Engine
This is Rietveld 408576698