Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (224956 => 224957)
--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp 2017-11-17 02:36:03 UTC (rev 224956)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp 2017-11-17 03:25:07 UTC (rev 224957)
@@ -30,7 +30,6 @@
#include "config.h"
#include "CSSPropertyAnimation.h"
-#include "AnimationBase.h"
#include "CSSComputedStyleDeclaration.h"
#include "CSSCrossfadeValue.h"
#include "CSSFilterImageValue.h"
@@ -37,6 +36,7 @@
#include "CSSImageGeneratorValue.h"
#include "CSSImageValue.h"
#include "CSSPrimitiveValue.h"
+#include "CSSPropertyBlendingClient.h"
#include "CSSPropertyNames.h"
#include "CachedImage.h"
#include "CalculationValue.h"
@@ -65,37 +65,37 @@
namespace WebCore {
-static inline int blendFunc(const AnimationBase*, int from, int to, double progress)
+static inline int blendFunc(const CSSPropertyBlendingClient*, int from, int to, double progress)
{
return blend(from, to, progress);
}
-static inline double blendFunc(const AnimationBase*, double from, double to, double progress)
+static inline double blendFunc(const CSSPropertyBlendingClient*, double from, double to, double progress)
{
return blend(from, to, progress);
}
-static inline float blendFunc(const AnimationBase*, float from, float to, double progress)
+static inline float blendFunc(const CSSPropertyBlendingClient*, float from, float to, double progress)
{
return narrowPrecisionToFloat(from + (to - from) * progress);
}
-static inline Color blendFunc(const AnimationBase*, const Color& from, const Color& to, double progress)
+static inline Color blendFunc(const CSSPropertyBlendingClient*, const Color& from, const Color& to, double progress)
{
return blend(from, to, progress);
}
-static inline Length blendFunc(const AnimationBase*, const Length& from, const Length& to, double progress)
+static inline Length blendFunc(const CSSPropertyBlendingClient*, const Length& from, const Length& to, double progress)
{
return blend(from, to, progress);
}
-static inline LengthSize blendFunc(const AnimationBase* anim, const LengthSize& from, const LengthSize& to, double progress)
+static inline LengthSize blendFunc(const CSSPropertyBlendingClient* anim, const LengthSize& from, const LengthSize& to, double progress)
{
return { blendFunc(anim, from.width, to.width, progress), blendFunc(anim, from.height, to.height, progress) };
}
-static inline ShadowStyle blendFunc(const AnimationBase* anim, ShadowStyle from, ShadowStyle to, double progress)
+static inline ShadowStyle blendFunc(const CSSPropertyBlendingClient* anim, ShadowStyle from, ShadowStyle to, double progress)
{
if (from == to)
return to;
@@ -106,7 +106,7 @@
return result > 0 ? Normal : Inset;
}
-static inline std::unique_ptr<ShadowData> blendFunc(const AnimationBase* anim, const ShadowData* from, const ShadowData* to, double progress)
+static inline std::unique_ptr<ShadowData> blendFunc(const CSSPropertyBlendingClient* anim, const ShadowData* from, const ShadowData* to, double progress)
{
ASSERT(from && to);
if (from->style() != to->style())
@@ -120,7 +120,7 @@
blend(from->color(), to->color(), progress));
}
-static inline TransformOperations blendFunc(const AnimationBase* animation, const TransformOperations& from, const TransformOperations& to, double progress)
+static inline TransformOperations blendFunc(const CSSPropertyBlendingClient* animation, const TransformOperations& from, const TransformOperations& to, double progress)
{
if (animation->transformFunctionListsMatch())
return to.blendByMatchingOperations(from, progress);
@@ -127,7 +127,7 @@
return to.blendByUsingMatrixInterpolation(from, progress, is<RenderBox>(animation->renderer()) ? downcast<RenderBox>(*animation->renderer()).borderBoxRect().size() : LayoutSize());
}
-static inline RefPtr<ClipPathOperation> blendFunc(const AnimationBase*, ClipPathOperation* from, ClipPathOperation* to, double progress)
+static inline RefPtr<ClipPathOperation> blendFunc(const CSSPropertyBlendingClient*, ClipPathOperation* from, ClipPathOperation* to, double progress)
{
if (!from || !to)
return to;
@@ -145,7 +145,7 @@
return ShapeClipPathOperation::create(toShape.blend(fromShape, progress));
}
-static inline RefPtr<ShapeValue> blendFunc(const AnimationBase*, ShapeValue* from, ShapeValue* to, double progress)
+static inline RefPtr<ShapeValue> blendFunc(const CSSPropertyBlendingClient*, ShapeValue* from, ShapeValue* to, double progress)
{
if (!from || !to)
return to;
@@ -165,13 +165,13 @@
return ShapeValue::create(toShape.blend(fromShape, progress), to->cssBox());
}
-static inline RefPtr<FilterOperation> blendFunc(const AnimationBase*, FilterOperation* fromOp, FilterOperation* toOp, double progress, bool blendToPassthrough = false)
+static inline RefPtr<FilterOperation> blendFunc(const CSSPropertyBlendingClient*, FilterOperation* fromOp, FilterOperation* toOp, double progress, bool blendToPassthrough = false)
{
ASSERT(toOp);
return toOp->blend(fromOp, progress, blendToPassthrough);
}
-static inline FilterOperations blendFilterOperations(const AnimationBase* anim, const FilterOperations& from, const FilterOperations& to, double progress)
+static inline FilterOperations blendFilterOperations(const CSSPropertyBlendingClient* anim, const FilterOperations& from, const FilterOperations& to, double progress)
{
FilterOperations result;
size_t fromSize = from.operations().size();
@@ -194,7 +194,7 @@
return result;
}
-static inline FilterOperations blendFunc(const AnimationBase* anim, const FilterOperations& from, const FilterOperations& to, double progress, bool animatingBackdropFilter = false)
+static inline FilterOperations blendFunc(const CSSPropertyBlendingClient* anim, const FilterOperations& from, const FilterOperations& to, double progress, bool animatingBackdropFilter = false)
{
FilterOperations result;
@@ -216,7 +216,7 @@
return result;
}
-static inline RefPtr<StyleImage> blendFilter(const AnimationBase* anim, CachedImage* image, const FilterOperations& from, const FilterOperations& to, double progress)
+static inline RefPtr<StyleImage> blendFilter(const CSSPropertyBlendingClient* anim, CachedImage* image, const FilterOperations& from, const FilterOperations& to, double progress)
{
ASSERT(image);
FilterOperations filterResult = blendFilterOperations(anim, from, to, progress);
@@ -229,7 +229,7 @@
return StyleGeneratedImage::create(WTFMove(result));
}
-static inline EVisibility blendFunc(const AnimationBase* anim, EVisibility from, EVisibility to, double progress)
+static inline EVisibility blendFunc(const CSSPropertyBlendingClient* anim, EVisibility from, EVisibility to, double progress)
{
// Any non-zero result means we consider the object to be visible. Only at 0 do we consider the object to be
// invisible. The invisible value we use (HIDDEN vs. COLLAPSE) depends on the specified from/to values.
@@ -241,7 +241,7 @@
return result > 0. ? VISIBLE : (to != VISIBLE ? to : from);
}
-static inline LengthBox blendFunc(const AnimationBase* anim, const LengthBox& from, const LengthBox& to, double progress)
+static inline LengthBox blendFunc(const CSSPropertyBlendingClient* anim, const LengthBox& from, const LengthBox& to, double progress)
{
LengthBox result(blendFunc(anim, from.top(), to.top(), progress),
blendFunc(anim, from.right(), to.right(), progress),
@@ -250,12 +250,12 @@
return result;
}
-static inline SVGLengthValue blendFunc(const AnimationBase*, const SVGLengthValue& from, const SVGLengthValue& to, double progress)
+static inline SVGLengthValue blendFunc(const CSSPropertyBlendingClient*, const SVGLengthValue& from, const SVGLengthValue& to, double progress)
{
return to.blend(from, narrowPrecisionToFloat(progress));
}
-static inline Vector<SVGLengthValue> blendFunc(const AnimationBase*, const Vector<SVGLengthValue>& from, const Vector<SVGLengthValue>& to, double progress)
+static inline Vector<SVGLengthValue> blendFunc(const CSSPropertyBlendingClient*, const Vector<SVGLengthValue>& from, const Vector<SVGLengthValue>& to, double progress)
{
size_t fromLength = from.size();
size_t toLength = to.size();
@@ -276,7 +276,7 @@
return result;
}
-static inline RefPtr<StyleImage> crossfadeBlend(const AnimationBase*, StyleCachedImage* fromStyleImage, StyleCachedImage* toStyleImage, double progress)
+static inline RefPtr<StyleImage> crossfadeBlend(const CSSPropertyBlendingClient*, StyleCachedImage* fromStyleImage, StyleCachedImage* toStyleImage, double progress)
{
// If progress is at one of the extremes, we want getComputedStyle to show the image,
// not a completed cross-fade, so we hand back one of the existing images.
@@ -295,7 +295,7 @@
return StyleGeneratedImage::create(WTFMove(crossfadeValue));
}
-static inline RefPtr<StyleImage> blendFunc(const AnimationBase* anim, StyleImage* from, StyleImage* to, double progress)
+static inline RefPtr<StyleImage> blendFunc(const CSSPropertyBlendingClient* anim, StyleImage* from, StyleImage* to, double progress)
{
if (!from || !to)
return to;
@@ -351,7 +351,7 @@
return to;
}
-static inline NinePieceImage blendFunc(const AnimationBase* anim, const NinePieceImage& from, const NinePieceImage& to, double progress)
+static inline NinePieceImage blendFunc(const CSSPropertyBlendingClient* anim, const NinePieceImage& from, const NinePieceImage& to, double progress)
{
if (!from.hasImage() || !to.hasImage())
return to;
@@ -372,7 +372,7 @@
#if ENABLE(VARIATION_FONTS)
-static inline FontVariationSettings blendFunc(const AnimationBase* anim, const FontVariationSettings& from, const FontVariationSettings& to, double progress)
+static inline FontVariationSettings blendFunc(const CSSPropertyBlendingClient* anim, const FontVariationSettings& from, const FontVariationSettings& to, double progress)
{
if (from.size() != to.size())
return FontVariationSettings();
@@ -391,7 +391,7 @@
#endif
-static inline FontSelectionValue blendFunc(const AnimationBase* anim, FontSelectionValue from, FontSelectionValue to, double progress)
+static inline FontSelectionValue blendFunc(const CSSPropertyBlendingClient* anim, FontSelectionValue from, FontSelectionValue to, double progress)
{
return FontSelectionValue(blendFunc(anim, static_cast<float>(from), static_cast<float>(to), progress));
}
@@ -408,7 +408,7 @@
virtual bool isShorthandWrapper() const { return false; }
virtual bool equals(const RenderStyle* a, const RenderStyle* b) const = 0;
- virtual void blend(const AnimationBase*, RenderStyle*, const RenderStyle*, const RenderStyle*, double) const = 0;
+ virtual void blend(const CSSPropertyBlendingClient*, RenderStyle*, const RenderStyle*, const RenderStyle*, double) const = 0;
#if !LOG_DISABLED
virtual void logBlend(const RenderStyle* a, const RenderStyle* b, const RenderStyle* result, double) const = 0;
@@ -467,7 +467,7 @@
{
}
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
(dst->*m_setter)(blendFunc(anim, (a->*PropertyWrapperGetter<T>::m_getter)(), (b->*PropertyWrapperGetter<T>::m_getter)(), progress));
}
@@ -486,7 +486,7 @@
{
}
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
(dst->*m_setter)(blendFunc(anim, (a->*PropertyWrapperGetter<T*>::m_getter)(), (b->*PropertyWrapperGetter<T*>::m_getter)(), progress));
}
@@ -505,7 +505,7 @@
{
}
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
(dst->*m_setter)(blendFunc(anim, (a->*PropertyWrapperGetter<const T&>::m_getter)(), (b->*PropertyWrapperGetter<const T&>::m_getter)(), progress));
}
@@ -623,7 +623,7 @@
{
}
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
(dst->*m_setter)(blendFunc(anim, (a->*PropertyWrapperGetter<const Color&>::m_getter)(), (b->*PropertyWrapperGetter<const Color&>::m_getter)(), progress));
}
@@ -642,7 +642,7 @@
bool animationIsAccelerated() const override { return true; }
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
dst->setOpacity(blendFunc(anim, a->opacity(), b->opacity(), progress));
}
@@ -658,7 +658,7 @@
bool animationIsAccelerated() const override { return true; }
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
dst->setTransform(blendFunc(anim, a->transform(), b->transform(), progress));
}
@@ -674,7 +674,7 @@
bool animationIsAccelerated() const override { return true; }
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
dst->setFilter(blendFunc(anim, a->filter(), b->filter(), progress));
}
@@ -691,7 +691,7 @@
virtual bool animationIsAccelerated() const { return true; }
- virtual void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const
+ virtual void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const
{
dst->setBackdropFilter(blendFunc(anim, a->backdropFilter(), b->backdropFilter(), progress, true));
}
@@ -761,7 +761,7 @@
return true;
}
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
const ShadowData* shadowA = (a->*m_getter)();
const ShadowData* shadowB = (b->*m_getter)();
@@ -786,7 +786,7 @@
#endif
private:
- std::unique_ptr<ShadowData> blendSimpleOrMatchedShadowLists(const AnimationBase* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB) const
+ std::unique_ptr<ShadowData> blendSimpleOrMatchedShadowLists(const CSSPropertyBlendingClient* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB) const
{
std::unique_ptr<ShadowData> newShadowData;
ShadowData* lastShadow = 0;
@@ -812,7 +812,7 @@
return newShadowData;
}
- std::unique_ptr<ShadowData> blendMismatchedShadowLists(const AnimationBase* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB, int fromLength, int toLength) const
+ std::unique_ptr<ShadowData> blendMismatchedShadowLists(const CSSPropertyBlendingClient* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB, int fromLength, int toLength) const
{
// The shadows in ShadowData are stored in reverse order, so when animating mismatched lists,
// reverse them and match from the end.
@@ -882,7 +882,7 @@
return fromColor == toColor;
}
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
Color fromColor = value(a);
Color toColor = value(b);
@@ -938,7 +938,7 @@
{
return m_wrapper->equals(a, b) && m_visitedWrapper->equals(a, b);
}
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
m_wrapper->blend(anim, dst, a, b, progress);
m_visitedWrapper->blend(anim, dst, a, b, progress);
@@ -970,7 +970,7 @@
CSSPropertyID property() const { return m_property; }
virtual bool equals(const FillLayer*, const FillLayer*) const = 0;
- virtual void blend(const AnimationBase*, FillLayer*, const FillLayer*, const FillLayer*, double) const = 0;
+ virtual void blend(const CSSPropertyBlendingClient*, FillLayer*, const FillLayer*, const FillLayer*, double) const = 0;
#if !LOG_DISABLED
virtual void logBlend(const FillLayer* result, const FillLayer*, const FillLayer*, double) const = 0;
@@ -1025,7 +1025,7 @@
{
}
- void blend(const AnimationBase* anim, FillLayer* dst, const FillLayer* a, const FillLayer* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, FillLayer* dst, const FillLayer* a, const FillLayer* b, double progress) const override
{
(dst->*m_setter)(blendFunc(anim, (a->*FillLayerPropertyWrapperGetter<const T&>::m_getter)(), (b->*FillLayerPropertyWrapperGetter<const T&>::m_getter)(), progress));
}
@@ -1072,7 +1072,7 @@
return fromLength == toLength && fromEdge == toEdge;
}
- void blend(const AnimationBase* anim, FillLayer* dst, const FillLayer* a, const FillLayer* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, FillLayer* dst, const FillLayer* a, const FillLayer* b, double progress) const override
{
Length fromLength = (a->*FillLayerPropertyWrapperGetter<const Length&>::m_getter)();
Length toLength = (b->*FillLayerPropertyWrapperGetter<const Length&>::m_getter)();
@@ -1117,7 +1117,7 @@
{
}
- void blend(const AnimationBase* anim, FillLayer* dst, const FillLayer* a, const FillLayer* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, FillLayer* dst, const FillLayer* a, const FillLayer* b, double progress) const override
{
(dst->*m_setter)(blendFunc(anim, (a->*FillLayerPropertyWrapperGetter<T*>::m_getter)(), (b->*FillLayerPropertyWrapperGetter<T*>::m_getter)(), progress));
}
@@ -1218,7 +1218,7 @@
return true;
}
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
auto* aLayer = &(a->*m_layersGetter)();
auto* bLayer = &(b->*m_layersGetter)();
@@ -1280,7 +1280,7 @@
return true;
}
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
for (auto& wrapper : m_propertyWrappers)
wrapper->blend(anim, dst, a, b, progress);
@@ -1318,7 +1318,7 @@
return a->flexBasis() == b->flexBasis() && a->flexGrow() == b->flexGrow() && a->flexShrink() == b->flexShrink();
}
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
dst->setFlexBasis(blendFunc(anim, a->flexBasis(), b->flexBasis(), progress));
dst->setFlexGrow(blendFunc(anim, a->flexGrow(), b->flexGrow(), progress));
@@ -1375,7 +1375,7 @@
return true;
}
- void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
+ void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
{
if ((a->*m_paintTypeGetter)() != SVG_PAINTTYPE_RGBCOLOR
|| (b->*m_paintTypeGetter)() != SVG_PAINTTYPE_RGBCOLOR)
@@ -1701,7 +1701,7 @@
}
// Returns true if we need to start animation timers
-bool CSSPropertyAnimation::blendProperties(const AnimationBase* anim, CSSPropertyID prop, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress)
+bool CSSPropertyAnimation::blendProperties(const CSSPropertyBlendingClient* anim, CSSPropertyID prop, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress)
{
ASSERT(prop != CSSPropertyInvalid);