| Index: third_party/WebKit/Source/core/animation/EffectModel.h
|
| diff --git a/third_party/WebKit/Source/core/animation/EffectModel.h b/third_party/WebKit/Source/core/animation/EffectModel.h
|
| index cdf0cb6d54c5cb0fcac41e396aee596159902a61..86c58b93bf77fce98f4758c720045ea9c1b6831e 100644
|
| --- a/third_party/WebKit/Source/core/animation/EffectModel.h
|
| +++ b/third_party/WebKit/Source/core/animation/EffectModel.h
|
| @@ -34,6 +34,7 @@
|
| #include "bindings/core/v8/ScriptWrappable.h"
|
| #include "core/CSSPropertyNames.h"
|
| #include "core/CoreExport.h"
|
| +#include "core/animation/AnimationEffect.h"
|
| #include "core/animation/PropertyHandle.h"
|
| #include "platform/heap/Handle.h"
|
| #include "wtf/HashMap.h"
|
| @@ -52,15 +53,49 @@ public:
|
| CompositeAdd,
|
| };
|
|
|
| - EffectModel() { }
|
| virtual ~EffectModel() { }
|
| - virtual bool sample(int iteration, double fraction, double iterationDuration, Vector<RefPtr<Interpolation>>&) const = 0;
|
|
|
| - virtual bool affects(PropertyHandle) const { return false; }
|
| - virtual bool isTransformRelatedEffect() const { return false; }
|
| + bool sample(int iteration, double fraction, double iterationDuration, Vector<RefPtr<Interpolation>>& result) const
|
| + {
|
| + DCHECK_GE(iteration, 0);
|
| + DCHECK(!isNull(fraction));
|
| + bool changed = iteration != m_lastIteration || fraction != m_lastFraction || iterationDuration != m_lastIterationDuration;
|
| + m_lastIteration = iteration;
|
| + m_lastFraction = fraction;
|
| + m_lastIterationDuration = iterationDuration;
|
| + sampleImpl(iteration, fraction, iterationDuration, result);
|
| + return changed;
|
| + }
|
| +
|
| + virtual bool affects(PropertyHandle) const = 0;
|
| + bool isTransformRelatedEffect() const
|
| + {
|
| + return affects(PropertyHandle(CSSPropertyTransform))
|
| + || affects(PropertyHandle(CSSPropertyRotate))
|
| + || affects(PropertyHandle(CSSPropertyScale))
|
| + || affects(PropertyHandle(CSSPropertyTranslate));
|
| + }
|
| +
|
| virtual bool isKeyframeEffectModel() const { return false; }
|
| + virtual bool isTransitionEffectModel() const { return false; }
|
|
|
| DEFINE_INLINE_VIRTUAL_TRACE() { }
|
| +
|
| +protected:
|
| + EffectModel()
|
| + : m_lastIteration(0)
|
| + , m_lastFraction(nullValue())
|
| + , m_lastIterationDuration(0)
|
| + { }
|
| +
|
| + virtual void sampleImpl(int iteration, double fraction, double iterationDuration, Vector<RefPtr<Interpolation>>&) const = 0;
|
| +
|
| + void clearLastFraction() const { m_lastFraction = nullValue(); }
|
| +
|
| +private:
|
| + mutable int m_lastIteration;
|
| + mutable double m_lastFraction;
|
| + mutable double m_lastIterationDuration;
|
| };
|
|
|
| } // namespace blink
|
|
|