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

Unified Diff: Source/core/animation/InvalidatableStyleInterpolation.cpp

Issue 1326943003: Moar comments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/InvalidatableStyleInterpolation.cpp
diff --git a/Source/core/animation/InvalidatableStyleInterpolation.cpp b/Source/core/animation/InvalidatableStyleInterpolation.cpp
index 1de10b401231bfa59ee073ddfefec095dfb23b22..49dc3a5b1082250960c512ed59d478f177fbca37 100644
--- a/Source/core/animation/InvalidatableStyleInterpolation.cpp
+++ b/Source/core/animation/InvalidatableStyleInterpolation.cpp
@@ -128,12 +128,14 @@ void InvalidatableStyleInterpolation::applyStack(const ActiveInterpolations& int
while (startingIndex > 0 && toInvalidatableStyleInterpolation(*interpolations.at(startingIndex)).dependsOnUnderlyingValue())
startingIndex--;
+ // Compute the underlying value to composite onto.
OwnPtr<InterpolationValue> underlyingValueOwner = nullptr;
InterpolationValue* underlyingValue = nullptr;
- bool shouldApply = false;
-
const InvalidatableStyleInterpolation& firstInterpolation = toInvalidatableStyleInterpolation(*interpolations.at(startingIndex));
- if (!firstInterpolation.dependsOnUnderlyingValue()) {
+ if (firstInterpolation.dependsOnUnderlyingValue()) {
+ underlyingValueOwner = firstInterpolation.maybeConvertUnderlyingValue(state);
+ underlyingValue = underlyingValueOwner.get();
+ } else {
firstInterpolation.ensureValidInterpolation(state, nullptr);
// Fast path for replace interpolations that are the last to apply.
if (startingIndex == interpolations.size() - 1) {
@@ -148,11 +150,8 @@ void InvalidatableStyleInterpolation::applyStack(const ActiveInterpolations& int
startingIndex++;
}
- if (!underlyingValue && startingIndex < interpolations.size()) {
- underlyingValueOwner = toInvalidatableStyleInterpolation(*interpolations.at(startingIndex)).maybeConvertUnderlyingValue(state);
- underlyingValue = underlyingValueOwner.get();
- }
-
+ // Composite interpolations onto the underlying value.
+ bool shouldApply = false;
for (size_t i = startingIndex; i < interpolations.size(); i++) {
const InvalidatableStyleInterpolation& currentInterpolation = toInvalidatableStyleInterpolation(*interpolations.at(i));
ASSERT(currentInterpolation.dependsOnUnderlyingValue());
@@ -179,6 +178,7 @@ void InvalidatableStyleInterpolation::applyStack(const ActiveInterpolations& int
underlyingValue->interpolableValue().scaleAndAdd(underlyingFraction, currentInterpolation.m_cachedValue->interpolableValue());
}
}
+
if (shouldApply && underlyingValue) {
underlyingValue->type().apply(underlyingValue->interpolableValue(), underlyingValue->nonInterpolableValue(), state);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698