| Index: Source/core/animation/CompositorAnimationsTest.cpp
|
| diff --git a/Source/core/animation/CompositorAnimationsTest.cpp b/Source/core/animation/CompositorAnimationsTest.cpp
|
| index fada24211759bfda9687259a47481ffcf90d1204..4513b9de335977c6b529d6ea067905210e3d7ef9 100644
|
| --- a/Source/core/animation/CompositorAnimationsTest.cpp
|
| +++ b/Source/core/animation/CompositorAnimationsTest.cpp
|
| @@ -76,14 +76,14 @@ protected:
|
|
|
| Timing m_timing;
|
| CompositorAnimationsImpl::CompositorTiming m_compositorTiming;
|
| - OwnPtrWillBePersistent<AnimatableValueKeyframeVector> m_keyframeVector2;
|
| - RefPtrWillBePersistent<AnimatableValueKeyframeEffectModel> m_keyframeAnimationEffect2;
|
| - OwnPtrWillBePersistent<AnimatableValueKeyframeVector> m_keyframeVector5;
|
| - RefPtrWillBePersistent<AnimatableValueKeyframeEffectModel> m_keyframeAnimationEffect5;
|
| + Persistent<AnimatableValueKeyframeVector> m_keyframeVector2;
|
| + Persistent<AnimatableValueKeyframeEffectModel> m_keyframeAnimationEffect2;
|
| + Persistent<AnimatableValueKeyframeVector> m_keyframeVector5;
|
| + Persistent<AnimatableValueKeyframeEffectModel> m_keyframeAnimationEffect5;
|
|
|
| RefPtrWillBePersistent<Document> m_document;
|
| RefPtrWillBePersistent<Element> m_element;
|
| - RefPtrWillBePersistent<AnimationTimeline> m_timeline;
|
| + Persistent<AnimationTimeline> m_timeline;
|
|
|
| virtual void SetUp()
|
| {
|
| @@ -139,11 +139,11 @@ public:
|
| {
|
| EXPECT_EQ(frame->offset(), 0);
|
| AnimatableValueKeyframeVector frames;
|
| - RefPtrWillBeRawPtr<Keyframe> second = frame->cloneWithOffset(1);
|
| + Keyframe* second = frame->cloneWithOffset(1);
|
|
|
| frames.append(frame);
|
| - frames.append(toAnimatableValueKeyframe(second.get()));
|
| - return isCandidateForAnimationOnCompositor(m_timing, *AnimatableValueKeyframeEffectModel::create(frames).get());
|
| + frames.append(toAnimatableValueKeyframe(second));
|
| + return isCandidateForAnimationOnCompositor(m_timing, *AnimatableValueKeyframeEffectModel::create(frames));
|
| }
|
|
|
| // -------------------------------------------------------------------
|
| @@ -163,9 +163,9 @@ public:
|
| return timing;
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<AnimatableValueKeyframe> createReplaceOpKeyframe(CSSPropertyID id, AnimatableValue* value, double offset = 0)
|
| + AnimatableValueKeyframe* createReplaceOpKeyframe(CSSPropertyID id, AnimatableValue* value, double offset = 0)
|
| {
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframe> keyframe = AnimatableValueKeyframe::create();
|
| + AnimatableValueKeyframe* keyframe = AnimatableValueKeyframe::create();
|
| keyframe->setPropertyValue(id, value);
|
| keyframe->setComposite(AnimationEffect::CompositeReplace);
|
| keyframe->setOffset(offset);
|
| @@ -173,20 +173,20 @@ public:
|
| return keyframe;
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<AnimatableValueKeyframe> createDefaultKeyframe(CSSPropertyID id, AnimationEffect::CompositeOperation op, double offset = 0)
|
| + AnimatableValueKeyframe* createDefaultKeyframe(CSSPropertyID id, AnimationEffect::CompositeOperation op, double offset = 0)
|
| {
|
| - RefPtrWillBeRawPtr<AnimatableValue> value = nullptr;
|
| + AnimatableValue* value = nullptr;
|
| if (id == CSSPropertyTransform)
|
| value = AnimatableTransform::create(TransformOperations());
|
| else
|
| value = AnimatableDouble::create(10.0);
|
|
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframe> keyframe = createReplaceOpKeyframe(id, value.get(), offset);
|
| + AnimatableValueKeyframe* keyframe = createReplaceOpKeyframe(id, value, offset);
|
| keyframe->setComposite(op);
|
| return keyframe;
|
| }
|
|
|
| - PassOwnPtrWillBeRawPtr<AnimatableValueKeyframeVector> createCompositableFloatKeyframeVector(size_t n)
|
| + AnimatableValueKeyframeVector* createCompositableFloatKeyframeVector(size_t n)
|
| {
|
| Vector<double> values;
|
| for (size_t i = 0; i < n; i++) {
|
| @@ -195,34 +195,34 @@ public:
|
| return createCompositableFloatKeyframeVector(values);
|
| }
|
|
|
| - PassOwnPtrWillBeRawPtr<AnimatableValueKeyframeVector> createCompositableFloatKeyframeVector(Vector<double>& values)
|
| + AnimatableValueKeyframeVector* createCompositableFloatKeyframeVector(Vector<double>& values)
|
| {
|
| - OwnPtrWillBeRawPtr<AnimatableValueKeyframeVector> frames = adoptPtrWillBeNoop(new AnimatableValueKeyframeVector);
|
| + AnimatableValueKeyframeVector* frames = new AnimatableValueKeyframeVector;
|
| for (size_t i = 0; i < values.size(); i++) {
|
| double offset = 1.0 / (values.size() - 1) * i;
|
| - RefPtrWillBeRawPtr<AnimatableDouble> value = AnimatableDouble::create(values[i]);
|
| - frames->append(createReplaceOpKeyframe(CSSPropertyOpacity, value.get(), offset).get());
|
| + AnimatableDouble* value = AnimatableDouble::create(values[i]);
|
| + frames->append(createReplaceOpKeyframe(CSSPropertyOpacity, value, offset));
|
| }
|
| - return frames.release();
|
| + return frames;
|
| }
|
|
|
| - PassOwnPtrWillBeRawPtr<AnimatableValueKeyframeVector> createCompositableTransformKeyframeVector(const Vector<TransformOperations>& values)
|
| + AnimatableValueKeyframeVector* createCompositableTransformKeyframeVector(const Vector<TransformOperations>& values)
|
| {
|
| - OwnPtrWillBeRawPtr<AnimatableValueKeyframeVector> frames = adoptPtrWillBeNoop(new AnimatableValueKeyframeVector);
|
| + AnimatableValueKeyframeVector* frames = new AnimatableValueKeyframeVector;
|
| for (size_t i = 0; i < values.size(); ++i) {
|
| double offset = 1.0f / (values.size() - 1) * i;
|
| - RefPtrWillBeRawPtr<AnimatableTransform> value = AnimatableTransform::create(values[i]);
|
| - frames->append(createReplaceOpKeyframe(CSSPropertyTransform, value.get(), offset).get());
|
| + AnimatableTransform* value = AnimatableTransform::create(values[i]);
|
| + frames->append(createReplaceOpKeyframe(CSSPropertyTransform, value, offset));
|
| }
|
| - return frames.release();
|
| + return frames;
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> createKeyframeEffectModel(PassRefPtrWillBeRawPtr<AnimatableValueKeyframe> prpFrom, PassRefPtrWillBeRawPtr<AnimatableValueKeyframe> prpTo, PassRefPtrWillBeRawPtr<AnimatableValueKeyframe> prpC = nullptr, PassRefPtrWillBeRawPtr<AnimatableValueKeyframe> prpD = nullptr)
|
| + AnimatableValueKeyframeEffectModel* createKeyframeEffectModel(AnimatableValueKeyframe* prpFrom, AnimatableValueKeyframe* prpTo, AnimatableValueKeyframe* prpC = nullptr, AnimatableValueKeyframe* prpD = nullptr)
|
| {
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframe> from = prpFrom;
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframe> to = prpTo;
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframe> c = prpC;
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframe> d = prpD;
|
| + AnimatableValueKeyframe* from = prpFrom;
|
| + AnimatableValueKeyframe* to = prpTo;
|
| + AnimatableValueKeyframe* c = prpC;
|
| + AnimatableValueKeyframe* d = prpD;
|
|
|
| EXPECT_EQ(from->offset(), 0);
|
| AnimatableValueKeyframeVector frames;
|
| @@ -281,57 +281,57 @@ private:
|
|
|
| TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorKeyframeMultipleCSSProperties)
|
| {
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframe> keyframeGoodMultiple = createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace);
|
| - keyframeGoodMultiple->setPropertyValue(CSSPropertyTransform, AnimatableTransform::create(TransformOperations()).get());
|
| - EXPECT_TRUE(duplicateSingleKeyframeAndTestIsCandidateOnResult(keyframeGoodMultiple.get()));
|
| + AnimatableValueKeyframe* keyframeGoodMultiple = createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace);
|
| + keyframeGoodMultiple->setPropertyValue(CSSPropertyTransform, AnimatableTransform::create(TransformOperations()));
|
| + EXPECT_TRUE(duplicateSingleKeyframeAndTestIsCandidateOnResult(keyframeGoodMultiple));
|
|
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframe> keyframeBadMultipleID = createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace);
|
| - keyframeBadMultipleID->setPropertyValue(CSSPropertyOpacity, AnimatableDouble::create(10.0).get());
|
| - EXPECT_FALSE(duplicateSingleKeyframeAndTestIsCandidateOnResult(keyframeBadMultipleID.get()));
|
| + AnimatableValueKeyframe* keyframeBadMultipleID = createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace);
|
| + keyframeBadMultipleID->setPropertyValue(CSSPropertyOpacity, AnimatableDouble::create(10.0));
|
| + EXPECT_FALSE(duplicateSingleKeyframeAndTestIsCandidateOnResult(keyframeBadMultipleID));
|
| }
|
|
|
| TEST_F(AnimationCompositorAnimationsTest, isNotCandidateForCompositorAnimationTransformDependsOnBoxSize)
|
| {
|
| TransformOperations ops;
|
| ops.operations().append(TranslateTransformOperation::create(Length(2, Fixed), Length(2, Fixed), TransformOperation::TranslateX));
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframe> goodKeyframe = createReplaceOpKeyframe(CSSPropertyTransform, AnimatableTransform::create(ops).get());
|
| - EXPECT_TRUE(duplicateSingleKeyframeAndTestIsCandidateOnResult(goodKeyframe.get()));
|
| + AnimatableValueKeyframe* goodKeyframe = createReplaceOpKeyframe(CSSPropertyTransform, AnimatableTransform::create(ops));
|
| + EXPECT_TRUE(duplicateSingleKeyframeAndTestIsCandidateOnResult(goodKeyframe));
|
|
|
| ops.operations().append(TranslateTransformOperation::create(Length(50, Percent), Length(2, Fixed), TransformOperation::TranslateX));
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframe> badKeyframe = createReplaceOpKeyframe(CSSPropertyTransform, AnimatableTransform::create(ops).get());
|
| - EXPECT_FALSE(duplicateSingleKeyframeAndTestIsCandidateOnResult(badKeyframe.get()));
|
| + AnimatableValueKeyframe* badKeyframe = createReplaceOpKeyframe(CSSPropertyTransform, AnimatableTransform::create(ops));
|
| + EXPECT_FALSE(duplicateSingleKeyframeAndTestIsCandidateOnResult(badKeyframe));
|
|
|
| TransformOperations ops2;
|
| Length calcLength = Length(100, Percent).blend(Length(100, Fixed), 0.5, ValueRangeAll);
|
| ops2.operations().append(TranslateTransformOperation::create(calcLength, Length(0, Fixed), TransformOperation::TranslateX));
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframe> badKeyframe2 = createReplaceOpKeyframe(CSSPropertyTransform, AnimatableTransform::create(ops2).get());
|
| - EXPECT_FALSE(duplicateSingleKeyframeAndTestIsCandidateOnResult(badKeyframe2.get()));
|
| + AnimatableValueKeyframe* badKeyframe2 = createReplaceOpKeyframe(CSSPropertyTransform, AnimatableTransform::create(ops2));
|
| + EXPECT_FALSE(duplicateSingleKeyframeAndTestIsCandidateOnResult(badKeyframe2));
|
| }
|
|
|
| TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorKeyframeEffectModelMultipleFramesOkay)
|
| {
|
| AnimatableValueKeyframeVector framesSame;
|
| - framesSame.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0).get());
|
| - framesSame.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 1.0).get());
|
| - EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *AnimatableValueKeyframeEffectModel::create(framesSame).get()));
|
| + framesSame.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0));
|
| + framesSame.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 1.0));
|
| + EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *AnimatableValueKeyframeEffectModel::create(framesSame)));
|
|
|
| AnimatableValueKeyframeVector framesMixed;
|
| - framesMixed.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0).get());
|
| - framesMixed.append(createDefaultKeyframe(CSSPropertyTransform, AnimationEffect::CompositeReplace, 1.0).get());
|
| - EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *AnimatableValueKeyframeEffectModel::create(framesMixed).get()));
|
| + framesMixed.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0));
|
| + framesMixed.append(createDefaultKeyframe(CSSPropertyTransform, AnimationEffect::CompositeReplace, 1.0));
|
| + EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *AnimatableValueKeyframeEffectModel::create(framesMixed)));
|
| }
|
|
|
| TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorKeyframeEffectModel)
|
| {
|
| AnimatableValueKeyframeVector framesSame;
|
| - framesSame.append(createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace, 0.0).get());
|
| - framesSame.append(createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace, 1.0).get());
|
| - EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *AnimatableValueKeyframeEffectModel::create(framesSame).get()));
|
| + framesSame.append(createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace, 0.0));
|
| + framesSame.append(createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace, 1.0));
|
| + EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *AnimatableValueKeyframeEffectModel::create(framesSame)));
|
|
|
| AnimatableValueKeyframeVector framesMixedProperties;
|
| - framesMixedProperties.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0).get());
|
| - framesMixedProperties.append(createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace, 1.0).get());
|
| - EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *AnimatableValueKeyframeEffectModel::create(framesMixedProperties).get()));
|
| + framesMixedProperties.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0));
|
| + framesMixedProperties.append(createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace, 1.0));
|
| + EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *AnimatableValueKeyframeEffectModel::create(framesMixedProperties)));
|
| }
|
|
|
| TEST_F(AnimationCompositorAnimationsTest, AnimatedBoundingBox)
|
| @@ -341,21 +341,21 @@ TEST_F(AnimationCompositorAnimationsTest, AnimatedBoundingBox)
|
| transformVector.last().operations().append(TranslateTransformOperation::create(Length(0, Fixed), Length(0, Fixed), 0.0, TransformOperation::Translate3D));
|
| transformVector.append(TransformOperations());
|
| transformVector.last().operations().append(TranslateTransformOperation::create(Length(200, Fixed), Length(200, Fixed), 0.0, TransformOperation::Translate3D));
|
| - OwnPtrWillBePersistent<AnimatableValueKeyframeVector> frames = createCompositableTransformKeyframeVector(transformVector);
|
| + Persistent<AnimatableValueKeyframeVector> frames = createCompositableTransformKeyframeVector(transformVector);
|
| FloatBox bounds;
|
| - EXPECT_TRUE(getAnimationBounds(bounds, *AnimatableValueKeyframeEffectModel::create(*frames).get(), 0, 1));
|
| + EXPECT_TRUE(getAnimationBounds(bounds, *AnimatableValueKeyframeEffectModel::create(*frames), 0, 1));
|
| EXPECT_EQ(FloatBox(0.0f, 0.f, 0.0f, 200.0f, 200.0f, 0.0f), bounds);
|
| bounds = FloatBox();
|
| - EXPECT_TRUE(getAnimationBounds(bounds, *AnimatableValueKeyframeEffectModel::create(*frames).get(), -1, 1));
|
| + EXPECT_TRUE(getAnimationBounds(bounds, *AnimatableValueKeyframeEffectModel::create(*frames), -1, 1));
|
| EXPECT_EQ(FloatBox(-200.0f, -200.0, 0.0, 400.0f, 400.0f, 0.0f), bounds);
|
| transformVector.append(TransformOperations());
|
| transformVector.last().operations().append(TranslateTransformOperation::create(Length(-300, Fixed), Length(-400, Fixed), 1.0f, TransformOperation::Translate3D));
|
| bounds = FloatBox();
|
| frames = createCompositableTransformKeyframeVector(transformVector);
|
| - EXPECT_TRUE(getAnimationBounds(bounds, *AnimatableValueKeyframeEffectModel::create(*frames).get(), 0, 1));
|
| + EXPECT_TRUE(getAnimationBounds(bounds, *AnimatableValueKeyframeEffectModel::create(*frames), 0, 1));
|
| EXPECT_EQ(FloatBox(-300.0f, -400.f, 0.0f, 500.0f, 600.0f, 1.0f), bounds);
|
| bounds = FloatBox();
|
| - EXPECT_TRUE(getAnimationBounds(bounds, *AnimatableValueKeyframeEffectModel::create(*frames).get(), -1, 2));
|
| + EXPECT_TRUE(getAnimationBounds(bounds, *AnimatableValueKeyframeEffectModel::create(*frames), -1, 2));
|
| EXPECT_EQ(FloatBox(-1300.0f, -1600.f, 0.0f, 1500.0f, 1800.0f, 3.0f), bounds);
|
| }
|
|
|
| @@ -607,26 +607,26 @@ TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositor)
|
| Timing linearTiming(createCompositableTiming());
|
|
|
| AnimatableValueKeyframeVector basicFramesVector;
|
| - basicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0).get());
|
| - basicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 1.0).get());
|
| + basicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0));
|
| + basicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 1.0));
|
|
|
| AnimatableValueKeyframeVector nonBasicFramesVector;
|
| - nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0).get());
|
| - nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.5).get());
|
| - nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 1.0).get());
|
| + nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0));
|
| + nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.5));
|
| + nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 1.0));
|
|
|
| basicFramesVector[0]->setEasing(m_linearTimingFunction.get());
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> basicFrames = AnimatableValueKeyframeEffectModel::create(basicFramesVector).get();
|
| - EXPECT_TRUE(isCandidateForAnimationOnCompositor(linearTiming, *basicFrames.get()));
|
| + AnimatableValueKeyframeEffectModel* basicFrames = AnimatableValueKeyframeEffectModel::create(basicFramesVector);
|
| + EXPECT_TRUE(isCandidateForAnimationOnCompositor(linearTiming, *basicFrames));
|
|
|
| basicFramesVector[0]->setEasing(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn));
|
| - basicFrames = AnimatableValueKeyframeEffectModel::create(basicFramesVector).get();
|
| - EXPECT_TRUE(isCandidateForAnimationOnCompositor(linearTiming, *basicFrames.get()));
|
| + basicFrames = AnimatableValueKeyframeEffectModel::create(basicFramesVector);
|
| + EXPECT_TRUE(isCandidateForAnimationOnCompositor(linearTiming, *basicFrames));
|
|
|
| nonBasicFramesVector[0]->setEasing(m_linearTimingFunction.get());
|
| nonBasicFramesVector[1]->setEasing(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn));
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> nonBasicFrames = AnimatableValueKeyframeEffectModel::create(nonBasicFramesVector).get();
|
| - EXPECT_TRUE(isCandidateForAnimationOnCompositor(linearTiming, *nonBasicFrames.get()));
|
| + AnimatableValueKeyframeEffectModel* nonBasicFrames = AnimatableValueKeyframeEffectModel::create(nonBasicFramesVector);
|
| + EXPECT_TRUE(isCandidateForAnimationOnCompositor(linearTiming, *nonBasicFrames));
|
| }
|
|
|
| // -----------------------------------------------------------------------
|
| @@ -635,9 +635,9 @@ TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositor)
|
| TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimation)
|
| {
|
| // Animation to convert
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = createKeyframeEffectModel(
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0),
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
|
| + AnimatableValueKeyframeEffectModel* effect = createKeyframeEffectModel(
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0), 0),
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0), 1.0));
|
| // --
|
|
|
| WebCompositorSupportMock mockCompositor;
|
| @@ -673,7 +673,7 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimation)
|
| // Go!
|
| setCompositorForTesting(mockCompositor);
|
| Vector<OwnPtr<WebCompositorAnimation>> result;
|
| - getAnimationOnCompositor(m_timing, *effect.get(), result);
|
| + getAnimationOnCompositor(m_timing, *effect, result);
|
| EXPECT_EQ(1U, result.size());
|
| result[0].clear();
|
| }
|
| @@ -681,9 +681,9 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimation)
|
| TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationDuration)
|
| {
|
| // Animation to convert
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = createKeyframeEffectModel(
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0),
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
|
| + AnimatableValueKeyframeEffectModel* effect = createKeyframeEffectModel(
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0), 0),
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0), 1.0));
|
|
|
| m_timing.iterationDuration = 10.0;
|
| // --
|
| @@ -721,7 +721,7 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationDuration)
|
| // Go!
|
| setCompositorForTesting(mockCompositor);
|
| Vector<OwnPtr<WebCompositorAnimation>> result;
|
| - getAnimationOnCompositor(m_timing, *effect.get(), result);
|
| + getAnimationOnCompositor(m_timing, *effect, result);
|
| EXPECT_EQ(1U, result.size());
|
| result[0].clear();
|
| }
|
| @@ -729,11 +729,11 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationDuration)
|
| TEST_F(AnimationCompositorAnimationsTest, createMultipleKeyframeOpacityAnimationLinear)
|
| {
|
| // Animation to convert
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = createKeyframeEffectModel(
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0),
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(-1.0).get(), 0.25),
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(20.0).get(), 0.5),
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
|
| + AnimatableValueKeyframeEffectModel* effect = createKeyframeEffectModel(
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0), 0),
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(-1.0), 0.25),
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(20.0), 0.5),
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0), 1.0));
|
|
|
| m_timing.iterationCount = 5;
|
| m_timing.direction = Timing::PlaybackDirectionAlternate;
|
| @@ -776,7 +776,7 @@ TEST_F(AnimationCompositorAnimationsTest, createMultipleKeyframeOpacityAnimation
|
| // Go!
|
| setCompositorForTesting(mockCompositor);
|
| Vector<OwnPtr<WebCompositorAnimation>> result;
|
| - getAnimationOnCompositor(m_timing, *effect.get(), result);
|
| + getAnimationOnCompositor(m_timing, *effect, result);
|
| EXPECT_EQ(1U, result.size());
|
| result[0].clear();
|
| }
|
| @@ -784,9 +784,9 @@ TEST_F(AnimationCompositorAnimationsTest, createMultipleKeyframeOpacityAnimation
|
| TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationStartDelay)
|
| {
|
| // Animation to convert
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = createKeyframeEffectModel(
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0),
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
|
| + AnimatableValueKeyframeEffectModel* effect = createKeyframeEffectModel(
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0), 0),
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0), 1.0));
|
|
|
| m_timing.iterationCount = 5.0;
|
| m_timing.iterationDuration = 1.75;
|
| @@ -826,7 +826,7 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationStartDelay
|
| // Go!
|
| setCompositorForTesting(mockCompositor);
|
| Vector<OwnPtr<WebCompositorAnimation>> result;
|
| - getAnimationOnCompositor(m_timing, *effect.get(), result);
|
| + getAnimationOnCompositor(m_timing, *effect, result);
|
| EXPECT_EQ(1U, result.size());
|
| result[0].clear();
|
| }
|
| @@ -835,14 +835,14 @@ TEST_F(AnimationCompositorAnimationsTest, createMultipleKeyframeOpacityAnimation
|
| {
|
| // Animation to convert
|
| AnimatableValueKeyframeVector frames;
|
| - frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0));
|
| - frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(-1.0).get(), 0.25));
|
| - frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(20.0).get(), 0.5));
|
| - frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
|
| + frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0), 0));
|
| + frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(-1.0), 0.25));
|
| + frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(20.0), 0.5));
|
| + frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0), 1.0));
|
| frames[0]->setEasing(m_cubicEaseTimingFunction.get());
|
| frames[1]->setEasing(m_linearTimingFunction.get());
|
| frames[2]->setEasing(m_cubicCustomTimingFunction.get());
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = AnimatableValueKeyframeEffectModel::create(frames);
|
| + AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(frames);
|
|
|
| m_timing.timingFunction = m_linearTimingFunction.get();
|
| m_timing.iterationDuration = 2.0;
|
| @@ -886,7 +886,7 @@ TEST_F(AnimationCompositorAnimationsTest, createMultipleKeyframeOpacityAnimation
|
| // Go!
|
| setCompositorForTesting(mockCompositor);
|
| Vector<OwnPtr<WebCompositorAnimation>> result;
|
| - getAnimationOnCompositor(m_timing, *effect.get(), result);
|
| + getAnimationOnCompositor(m_timing, *effect, result);
|
| EXPECT_EQ(1U, result.size());
|
| result[0].clear();
|
| }
|
| @@ -897,14 +897,14 @@ TEST_F(AnimationCompositorAnimationsTest, createReversedOpacityAnimation)
|
|
|
| // Animation to convert
|
| AnimatableValueKeyframeVector frames;
|
| - frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0));
|
| - frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(-1.0).get(), 0.25));
|
| - frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(20.0).get(), 0.5));
|
| - frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
|
| + frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0), 0));
|
| + frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(-1.0), 0.25));
|
| + frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(20.0), 0.5));
|
| + frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0), 1.0));
|
| frames[0]->setEasing(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn));
|
| frames[1]->setEasing(m_linearTimingFunction.get());
|
| frames[2]->setEasing(cubicEasyFlipTimingFunction.get());
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = AnimatableValueKeyframeEffectModel::create(frames);
|
| + AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(frames);
|
|
|
| m_timing.timingFunction = m_linearTimingFunction.get();
|
| m_timing.iterationCount = 10;
|
| @@ -947,7 +947,7 @@ TEST_F(AnimationCompositorAnimationsTest, createReversedOpacityAnimation)
|
| // Go!
|
| setCompositorForTesting(mockCompositor);
|
| Vector<OwnPtr<WebCompositorAnimation>> result;
|
| - getAnimationOnCompositor(m_timing, *effect.get(), result);
|
| + getAnimationOnCompositor(m_timing, *effect, result);
|
| EXPECT_EQ(1U, result.size());
|
| result[0].clear();
|
| }
|
| @@ -955,9 +955,9 @@ TEST_F(AnimationCompositorAnimationsTest, createReversedOpacityAnimation)
|
| TEST_F(AnimationCompositorAnimationsTest, createReversedOpacityAnimationNegativeStartDelay)
|
| {
|
| // Animation to convert
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = createKeyframeEffectModel(
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0),
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
|
| + AnimatableValueKeyframeEffectModel* effect = createKeyframeEffectModel(
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0), 0),
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0), 1.0));
|
|
|
| m_timing.iterationCount = 5.0;
|
| m_timing.iterationDuration = 1.5;
|
| @@ -998,7 +998,7 @@ TEST_F(AnimationCompositorAnimationsTest, createReversedOpacityAnimationNegative
|
| // Go!
|
| setCompositorForTesting(mockCompositor);
|
| Vector<OwnPtr<WebCompositorAnimation>> result;
|
| - getAnimationOnCompositor(m_timing, *effect.get(), result);
|
| + getAnimationOnCompositor(m_timing, *effect, result);
|
| EXPECT_EQ(1U, result.size());
|
| result[0].clear();
|
| }
|
| @@ -1006,9 +1006,9 @@ TEST_F(AnimationCompositorAnimationsTest, createReversedOpacityAnimationNegative
|
| TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationPlaybackRates)
|
| {
|
| // Animation to convert
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = createKeyframeEffectModel(
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0),
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
|
| + AnimatableValueKeyframeEffectModel* effect = createKeyframeEffectModel(
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0), 0),
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0), 1.0));
|
|
|
| m_timing.playbackRate = 2;
|
| // --
|
| @@ -1047,7 +1047,7 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationPlaybackRa
|
| setCompositorForTesting(mockCompositor);
|
| Vector<OwnPtr<WebCompositorAnimation>> result;
|
| // Set player plaback rate also
|
| - getAnimationOnCompositor(m_timing, *effect.get(), result, -1.5);
|
| + getAnimationOnCompositor(m_timing, *effect, result, -1.5);
|
| EXPECT_EQ(1U, result.size());
|
| result[0].clear();
|
| }
|
| @@ -1055,9 +1055,9 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationPlaybackRa
|
| TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationFillModeNone)
|
| {
|
| // Animation to convert
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = createKeyframeEffectModel(
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0),
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
|
| + AnimatableValueKeyframeEffectModel* effect = createKeyframeEffectModel(
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0), 0),
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0), 1.0));
|
|
|
| m_timing.fillMode = Timing::FillModeNone;
|
|
|
| @@ -1095,7 +1095,7 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationFillModeNo
|
| // Go!
|
| setCompositorForTesting(mockCompositor);
|
| Vector<OwnPtr<WebCompositorAnimation>> result;
|
| - getAnimationOnCompositor(m_timing, *effect.get(), result);
|
| + getAnimationOnCompositor(m_timing, *effect, result);
|
| EXPECT_EQ(1U, result.size());
|
| result[0].clear();
|
| }
|
| @@ -1103,9 +1103,9 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationFillModeNo
|
| TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationFillModeAuto)
|
| {
|
| // Animation to convert
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = createKeyframeEffectModel(
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0),
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
|
| + AnimatableValueKeyframeEffectModel* effect = createKeyframeEffectModel(
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0), 0),
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0), 1.0));
|
|
|
| m_timing.fillMode = Timing::FillModeAuto;
|
|
|
| @@ -1143,7 +1143,7 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationFillModeAu
|
| // Go!
|
| setCompositorForTesting(mockCompositor);
|
| Vector<OwnPtr<WebCompositorAnimation>> result;
|
| - getAnimationOnCompositor(m_timing, *effect.get(), result);
|
| + getAnimationOnCompositor(m_timing, *effect, result);
|
| EXPECT_EQ(1U, result.size());
|
| result[0].clear();
|
| }
|
| @@ -1151,9 +1151,9 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationFillModeAu
|
| TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationWithTimingFunction)
|
| {
|
| // Animation to convert
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = createKeyframeEffectModel(
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0),
|
| - createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
|
| + AnimatableValueKeyframeEffectModel* effect = createKeyframeEffectModel(
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0), 0),
|
| + createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0), 1.0));
|
|
|
| m_timing.timingFunction = m_cubicCustomTimingFunction;
|
|
|
| @@ -1191,7 +1191,7 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationWithTiming
|
| // Go!
|
| setCompositorForTesting(mockCompositor);
|
| Vector<OwnPtr<WebCompositorAnimation>> result;
|
| - getAnimationOnCompositor(m_timing, *effect.get(), result);
|
| + getAnimationOnCompositor(m_timing, *effect, result);
|
| EXPECT_EQ(1U, result.size());
|
| result[0].clear();
|
| }
|
| @@ -1207,18 +1207,18 @@ TEST_F(AnimationCompositorAnimationsTest, CancelIncompatibleCompositorAnimations
|
| element->setLayoutObject(layoutObject);
|
|
|
| AnimatableValueKeyframeVector keyFrames;
|
| - keyFrames.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0).get());
|
| - keyFrames.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 1.0).get());
|
| - RefPtrWillBeRawPtr<AnimationEffect> animationEffect1 = AnimatableValueKeyframeEffectModel::create(keyFrames);
|
| - RefPtrWillBeRawPtr<AnimationEffect> animationEffect2 = AnimatableValueKeyframeEffectModel::create(keyFrames);
|
| + keyFrames.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0));
|
| + keyFrames.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 1.0));
|
| + AnimationEffect* animationEffect1 = AnimatableValueKeyframeEffectModel::create(keyFrames);
|
| + AnimationEffect* animationEffect2 = AnimatableValueKeyframeEffectModel::create(keyFrames);
|
|
|
| Timing timing;
|
| timing.iterationDuration = 1.f;
|
|
|
| // The first player for opacity is ok to run on compositor.
|
| - RefPtrWillBeRawPtr<Animation> animation1 = Animation::create(element.get(), animationEffect1, timing);
|
| - RefPtrWillBePersistent<AnimationPlayer> player1 = m_timeline->play(animation1.get());
|
| - EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(timing, *element.get(), player1.get(), *animationEffect1.get(), 1));
|
| + Animation* animation1 = Animation::create(element.get(), animationEffect1, timing);
|
| + RefPtrWillBePersistent<AnimationPlayer> player1 = m_timeline->play(animation1);
|
| + EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(timing, *element.get(), player1.get(), *animationEffect1, 1));
|
|
|
| // simulate Animation::maybeStartAnimationOnCompositor
|
| Vector<int> compositorAnimationIds;
|
| @@ -1227,9 +1227,9 @@ TEST_F(AnimationCompositorAnimationsTest, CancelIncompatibleCompositorAnimations
|
| EXPECT_TRUE(player1->hasActiveAnimationsOnCompositor());
|
|
|
| // The second player for opacity is not ok to run on compositor.
|
| - RefPtrWillBeRawPtr<Animation> animation2 = Animation::create(element.get(), animationEffect2, timing);
|
| - RefPtrWillBePersistent<AnimationPlayer> player2 = m_timeline->play(animation2.get());
|
| - EXPECT_FALSE(CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(timing, *element.get(), player2.get(), *animationEffect2.get(), 1));
|
| + Animation* animation2 = Animation::create(element.get(), animationEffect2, timing);
|
| + RefPtrWillBePersistent<AnimationPlayer> player2 = m_timeline->play(animation2);
|
| + EXPECT_FALSE(CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(timing, *element.get(), player2.get(), *animationEffect2, 1));
|
| EXPECT_FALSE(player2->hasActiveAnimationsOnCompositor());
|
|
|
| // A fallback to blink implementation needed, so cancel all compositor-side opacity animations for this element.
|
|
|