Index: Source/core/animation/AnimationStack.cpp |
diff --git a/Source/core/animation/AnimationStack.cpp b/Source/core/animation/AnimationStack.cpp |
index d6b55eccc798768cb4eb0664a90a322f9c3fbca4..b4b8705976f810ab9ad16b3c1f3921ac4f69944d 100644 |
--- a/Source/core/animation/AnimationStack.cpp |
+++ b/Source/core/animation/AnimationStack.cpp |
@@ -32,8 +32,9 @@ |
#include "core/animation/AnimationStack.h" |
#include "core/animation/CompositorAnimations.h" |
-#include "core/animation/StyleInterpolation.h" |
+#include "core/animation/InvalidatableStyleInterpolation.h" |
#include "core/animation/css/CSSAnimations.h" |
+#include "platform/RuntimeEnabledFeatures.h" |
#include "wtf/BitArray.h" |
#include "wtf/NonCopyingSort.h" |
#include <algorithm> |
@@ -42,10 +43,20 @@ namespace blink { |
namespace { |
-void copyToActiveInterpolationMap(const Vector<RefPtr<Interpolation>>& source, ActiveInterpolationMap& target) |
+void copyToActiveInterpolationMap(const Vector<RefPtr<Interpolation>>& source, ActiveInterpolationsMap& target) |
dstockwell
2015/09/07 03:11:36
copyToActiveInterpolation*s*Map?
alancutter (OOO until 2018)
2015/09/07 03:36:46
Done.
|
{ |
for (const auto& interpolation : source) { |
- target.set(interpolation->property(), interpolation.get()); |
+ ActiveInterpolationsMap::iterator entry = target.find(interpolation->property()); |
+ if (entry == target.end()) { |
+ // Python version of this line: target[interpolation.property] = [interpolation] |
+ target.set(interpolation->property(), ActiveInterpolations(1)).storedValue->value.at(0) = interpolation.get(); |
dstockwell
2015/09/07 03:11:36
is there a way to avoid the second hash here?
alancutter (OOO until 2018)
2015/09/07 03:36:46
Done.
|
+ } else if (RuntimeEnabledFeatures::stackedCSSPropertyAnimationsEnabled() |
+ && interpolation->isInvalidatableStyleInterpolation() |
+ && toInvalidatableStyleInterpolation(*interpolation).dependsOnUnderlyingValue()) { |
dstockwell
2015/09/07 03:11:36
Why is dependonunderlying part of invalidatablesty
alancutter (OOO until 2018)
2015/09/07 03:36:46
Correct, InvalidatableStyleInterpolation will even
|
+ entry->value.append(interpolation.get()); |
+ } else { |
+ entry->value.at(0) = interpolation.get(); |
+ } |
} |
} |
@@ -55,7 +66,7 @@ bool compareEffects(const Member<SampledEffect>& effect1, const Member<SampledEf |
return effect1->sequenceNumber() < effect2->sequenceNumber(); |
} |
-void copyNewAnimationsToActiveInterpolationMap(const HeapVector<Member<InertEffect>>& newAnimations, ActiveInterpolationMap& result) |
+void copyNewAnimationsToActiveInterpolationMap(const HeapVector<Member<InertEffect>>& newAnimations, ActiveInterpolationsMap& result) |
{ |
for (const auto& newAnimation : newAnimations) { |
OwnPtr<Vector<RefPtr<Interpolation>>> sample; |
@@ -81,11 +92,11 @@ bool AnimationStack::hasActiveAnimationsOnCompositor(CSSPropertyID property) con |
return false; |
} |
-ActiveInterpolationMap AnimationStack::activeInterpolations(AnimationStack* animationStack, const HeapVector<Member<InertEffect>>* newAnimations, const HeapHashSet<Member<const Animation>>* suppressedAnimations, KeyframeEffect::Priority priority, double timelineCurrentTime) |
+ActiveInterpolationsMap AnimationStack::activeInterpolations(AnimationStack* animationStack, const HeapVector<Member<InertEffect>>* newAnimations, const HeapHashSet<Member<const Animation>>* suppressedAnimations, KeyframeEffect::Priority priority, double timelineCurrentTime) |
{ |
// We don't exactly know when new animations will start, but timelineCurrentTime is a good estimate. |
- ActiveInterpolationMap result; |
+ ActiveInterpolationsMap result; |
if (animationStack) { |
HeapVector<Member<SampledEffect>>& effects = animationStack->m_effects; |