Commit 5cb2b197 authored by alancutter's avatar alancutter Committed by Commit bot

Remove unused code in DeferredLegacyStyleInterpolation

Review-Url: https://codereview.chromium.org/2042213002
Cr-Commit-Position: refs/heads/master@{#398261}
parent c0f67c55
......@@ -4,8 +4,6 @@
#include "core/animation/DeferredLegacyStyleInterpolation.h"
#include "core/animation/ElementAnimations.h"
#include "core/animation/css/CSSAnimatableValueFactory.h"
#include "core/css/CSSBasicShapeValues.h"
#include "core/css/CSSImageValue.h"
#include "core/css/CSSPrimitiveValue.h"
......@@ -14,34 +12,9 @@
#include "core/css/CSSShadowValue.h"
#include "core/css/CSSValueList.h"
#include "core/css/CSSValuePair.h"
#include "core/css/resolver/StyleResolver.h"
#include "core/css/resolver/StyleResolverState.h"
namespace blink {
void DeferredLegacyStyleInterpolation::apply(StyleResolverState& state) const
{
if (m_outdated || !state.element()->elementAnimations() || !state.element()->elementAnimations()->isAnimationStyleChange()) {
RefPtr<AnimatableValue> startAnimatableValue;
RefPtr<AnimatableValue> endAnimatableValue;
// Snapshot underlying values for neutral keyframes first because non-neutral keyframes will mutate the StyleResolverState.
if (!m_endCSSValue) {
endAnimatableValue = StyleResolver::createAnimatableValueSnapshot(state, m_id, m_endCSSValue.get());
startAnimatableValue = StyleResolver::createAnimatableValueSnapshot(state, m_id, m_startCSSValue.get());
} else {
startAnimatableValue = StyleResolver::createAnimatableValueSnapshot(state, m_id, m_startCSSValue.get());
endAnimatableValue = StyleResolver::createAnimatableValueSnapshot(state, m_id, m_endCSSValue.get());
}
m_innerInterpolation = LegacyStyleInterpolation::create(startAnimatableValue, endAnimatableValue, m_id);
m_outdated = false;
}
m_innerInterpolation->interpolate(m_cachedIteration, m_cachedFraction);
m_innerInterpolation->apply(state);
}
bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const CSSValue& value)
{
// FIXME: should not require resolving styles for inherit/initial/unset.
......
......@@ -6,9 +6,7 @@
#define DeferredLegacyStyleInterpolation_h
#include "core/CoreExport.h"
#include "core/animation/LegacyStyleInterpolation.h"
#include "core/animation/StyleInterpolation.h"
#include "core/css/CSSValue.h"
#include "wtf/Allocator.h"
namespace blink {
......@@ -21,18 +19,14 @@ class CSSPrimitiveValue;
class CSSQuadValue;
class CSSShadowValue;
class CSSSVGDocumentValue;
class CSSValue;
class CSSValueList;
class CSSValuePair;
class CORE_EXPORT DeferredLegacyStyleInterpolation : public StyleInterpolation {
// TODO(alancutter): Remove this once compositor keyframes are no longer snapshot during EffectInput::convert().
class CORE_EXPORT DeferredLegacyStyleInterpolation {
public:
static PassRefPtr<DeferredLegacyStyleInterpolation> create(CSSValue* start, CSSValue* end, CSSPropertyID id)
{
return adoptRef(new DeferredLegacyStyleInterpolation(start, end, id));
}
void apply(StyleResolverState&) const override;
STATIC_ONLY(DeferredLegacyStyleInterpolation);
static bool interpolationRequiresStyleResolve(const CSSValue&);
static bool interpolationRequiresStyleResolve(const CSSPrimitiveValue&);
static bool interpolationRequiresStyleResolve(const CSSImageValue&);
......@@ -45,20 +39,6 @@ public:
static bool interpolationRequiresStyleResolve(const CSSBasicShapePolygonValue&);
static bool interpolationRequiresStyleResolve(const CSSBasicShapeInsetValue&);
static bool interpolationRequiresStyleResolve(const CSSQuadValue&);
private:
DeferredLegacyStyleInterpolation(CSSValue* start, CSSValue* end, CSSPropertyID id)
: StyleInterpolation(InterpolableNumber::create(0), InterpolableNumber::create(1), id)
, m_startCSSValue(start)
, m_endCSSValue(end)
, m_outdated(true)
{
}
Persistent<CSSValue> m_startCSSValue;
Persistent<CSSValue> m_endCSSValue;
mutable RefPtr<LegacyStyleInterpolation> m_innerInterpolation;
mutable bool m_outdated;
};
} // namespace blink
......
......@@ -34,10 +34,10 @@
#include "core/animation/Animation.h"
#include "core/animation/AnimationTimeline.h"
#include "core/animation/CompositorAnimations.h"
#include "core/animation/DeferredLegacyStyleInterpolation.h"
#include "core/animation/ElementAnimations.h"
#include "core/animation/Interpolation.h"
#include "core/animation/KeyframeEffectModel.h"
#include "core/animation/LegacyStyleInterpolation.h"
#include "core/animation/css/CSSAnimatableValueFactory.h"
#include "core/css/CSSKeyframeRule.h"
#include "core/css/CSSPropertyEquality.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment