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

Unified Diff: third_party/WebKit/Source/core/animation/InvalidatableInterpolation.cpp

Issue 2555103002: Rename InvalidatableInterpolation cache to be explicitly about value conversion (Closed)
Patch Set: Whitespace Created 4 years 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 | « third_party/WebKit/Source/core/animation/InvalidatableInterpolation.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/InvalidatableInterpolation.cpp
diff --git a/third_party/WebKit/Source/core/animation/InvalidatableInterpolation.cpp b/third_party/WebKit/Source/core/animation/InvalidatableInterpolation.cpp
index 87b6fbc5e4e9f5e5c7c46154251289dad8f21ccc..e480166ee7911ad9307bbc574689bfd142d7af45 100644
--- a/third_party/WebKit/Source/core/animation/InvalidatableInterpolation.cpp
+++ b/third_party/WebKit/Source/core/animation/InvalidatableInterpolation.cpp
@@ -16,13 +16,14 @@ void InvalidatableInterpolation::interpolate(int, double fraction) {
return;
if (m_currentFraction == 0 || m_currentFraction == 1 || fraction == 0 ||
- fraction == 1)
- clearCache();
+ fraction == 1) {
+ clearConversionCache();
+ }
m_currentFraction = fraction;
- if (m_isCached && m_cachedPairConversion)
+ if (m_isConversionCached && m_cachedPairConversion)
m_cachedPairConversion->interpolateValue(fraction, m_cachedValue);
- // We defer the interpolation to ensureValidInterpolation() if
+ // We defer the interpolation to ensureValidConversion() if
// m_cachedPairConversion is null.
}
@@ -110,17 +111,17 @@ bool InvalidatableInterpolation::isNeutralKeyframeActive() const {
(m_endKeyframe->isNeutral() && m_currentFraction != 0);
}
-void InvalidatableInterpolation::clearCache() const {
- m_isCached = false;
+void InvalidatableInterpolation::clearConversionCache() const {
+ m_isConversionCached = false;
m_cachedPairConversion.reset();
m_conversionCheckers.clear();
m_cachedValue.reset();
}
-bool InvalidatableInterpolation::isCacheValid(
+bool InvalidatableInterpolation::isConversionCacheValid(
const InterpolationEnvironment& environment,
const UnderlyingValueOwner& underlyingValueOwner) const {
- if (!m_isCached)
+ if (!m_isConversionCached)
return false;
if (isNeutralKeyframeActive()) {
if (m_cachedPairConversion && m_cachedPairConversion->isFlip())
@@ -139,13 +140,13 @@ bool InvalidatableInterpolation::isCacheValid(
}
const TypedInterpolationValue*
-InvalidatableInterpolation::ensureValidInterpolation(
+InvalidatableInterpolation::ensureValidConversion(
const InterpolationEnvironment& environment,
const UnderlyingValueOwner& underlyingValueOwner) const {
DCHECK(!std::isnan(m_currentFraction));
- if (isCacheValid(environment, underlyingValueOwner))
+ if (isConversionCacheValid(environment, underlyingValueOwner))
return m_cachedValue.get();
- clearCache();
+ clearConversionCache();
if (m_currentFraction == 0) {
m_cachedValue = convertSingleKeyframe(*m_startKeyframe, environment,
underlyingValueOwner);
@@ -167,7 +168,7 @@ InvalidatableInterpolation::ensureValidInterpolation(
}
m_cachedPairConversion->interpolateValue(m_currentFraction, m_cachedValue);
}
- m_isCached = true;
+ m_isConversionCached = true;
return m_cachedValue.get();
}
@@ -212,8 +213,8 @@ void InvalidatableInterpolation::applyStack(
firstInterpolation.maybeConvertUnderlyingValue(environment));
} else {
const TypedInterpolationValue* firstValue =
- firstInterpolation.ensureValidInterpolation(environment,
- underlyingValueOwner);
+ firstInterpolation.ensureValidConversion(environment,
+ underlyingValueOwner);
// Fast path for replace interpolations that are the only one to apply.
if (interpolations.size() == 1) {
if (firstValue) {
@@ -235,8 +236,8 @@ void InvalidatableInterpolation::applyStack(
toInvalidatableInterpolation(*interpolations.at(i));
DCHECK(currentInterpolation.dependsOnUnderlyingValue());
const TypedInterpolationValue* currentValue =
- currentInterpolation.ensureValidInterpolation(environment,
- underlyingValueOwner);
+ currentInterpolation.ensureValidConversion(environment,
+ underlyingValueOwner);
if (!currentValue)
continue;
shouldApply = true;
« no previous file with comments | « third_party/WebKit/Source/core/animation/InvalidatableInterpolation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698