| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 chainedTimingFunc->appendSegment(0.5, m_linearTimingFunction.get()); | 704 chainedTimingFunc->appendSegment(0.5, m_linearTimingFunction.get()); |
| 705 chainedTimingFunc->appendSegment(1.0, cubicTimingFunc.get()); | 705 chainedTimingFunc->appendSegment(1.0, cubicTimingFunc.get()); |
| 706 Timing chainedTiming(createCompositableTiming()); | 706 Timing chainedTiming(createCompositableTiming()); |
| 707 chainedTiming.timingFunction = chainedTimingFunc; | 707 chainedTiming.timingFunction = chainedTimingFunc; |
| 708 | 708 |
| 709 KeyframeAnimationEffect::KeyframeVector basicFramesVector; | 709 KeyframeAnimationEffect::KeyframeVector basicFramesVector; |
| 710 basicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, Animation
Effect::CompositeReplace, 0.0).get()); | 710 basicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, Animation
Effect::CompositeReplace, 0.0).get()); |
| 711 basicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, Animation
Effect::CompositeReplace, 1.0).get()); | 711 basicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, Animation
Effect::CompositeReplace, 1.0).get()); |
| 712 RefPtr<KeyframeAnimationEffect> basicFrames = KeyframeAnimationEffect::creat
e(basicFramesVector).get(); | 712 RefPtr<KeyframeAnimationEffect> basicFrames = KeyframeAnimationEffect::creat
e(basicFramesVector).get(); |
| 713 | 713 |
| 714 EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForCompositorAnimat
ion(linearTiming, *basicFrames.get())); | 714 EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForCompositorAnimat
ions(linearTiming, *basicFrames.get())); |
| 715 EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForCompositorAnimat
ion(cubicTiming, *basicFrames.get())); | 715 EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForCompositorAnimat
ions(cubicTiming, *basicFrames.get())); |
| 716 // number of timing function and keyframes don't match | 716 // number of timing function and keyframes don't match |
| 717 EXPECT_FALSE(CompositorAnimations::instance()->isCandidateForCompositorAnima
tion(chainedTiming, *basicFrames.get())); | 717 EXPECT_FALSE(CompositorAnimations::instance()->isCandidateForCompositorAnima
tions(chainedTiming, *basicFrames.get())); |
| 718 | 718 |
| 719 KeyframeAnimationEffect::KeyframeVector nonBasicFramesVector; | 719 KeyframeAnimationEffect::KeyframeVector nonBasicFramesVector; |
| 720 nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, Animat
ionEffect::CompositeReplace, 0.0).get()); | 720 nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, Animat
ionEffect::CompositeReplace, 0.0).get()); |
| 721 nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, Animat
ionEffect::CompositeReplace, 0.5).get()); | 721 nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, Animat
ionEffect::CompositeReplace, 0.5).get()); |
| 722 nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, Animat
ionEffect::CompositeReplace, 1.0).get()); | 722 nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, Animat
ionEffect::CompositeReplace, 1.0).get()); |
| 723 RefPtr<KeyframeAnimationEffect> nonBasicFrames = KeyframeAnimationEffect::cr
eate(nonBasicFramesVector).get(); | 723 RefPtr<KeyframeAnimationEffect> nonBasicFrames = KeyframeAnimationEffect::cr
eate(nonBasicFramesVector).get(); |
| 724 | 724 |
| 725 EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForCompositorAnimat
ion(linearTiming, *nonBasicFrames.get())); | 725 EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForCompositorAnimat
ions(linearTiming, *nonBasicFrames.get())); |
| 726 EXPECT_FALSE(CompositorAnimations::instance()->isCandidateForCompositorAnima
tion(cubicTiming, *nonBasicFrames.get())); | 726 EXPECT_FALSE(CompositorAnimations::instance()->isCandidateForCompositorAnima
tions(cubicTiming, *nonBasicFrames.get())); |
| 727 EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForCompositorAnimat
ion(chainedTiming, *nonBasicFrames.get())); | 727 EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForCompositorAnimat
ions(chainedTiming, *nonBasicFrames.get())); |
| 728 } | 728 } |
| 729 | 729 |
| 730 // ----------------------------------------------------------------------- | 730 // ----------------------------------------------------------------------- |
| 731 // ----------------------------------------------------------------------- | 731 // ----------------------------------------------------------------------- |
| 732 | 732 |
| 733 TEST_F(CoreAnimationCompositorAnimationsTest, createSimpleOpacityAnimation) | 733 TEST_F(CoreAnimationCompositorAnimationsTest, createSimpleOpacityAnimation) |
| 734 { | 734 { |
| 735 // Animation to convert | 735 // Animation to convert |
| 736 RefPtr<KeyframeAnimationEffect> effect = createKeyframeAnimationEffect( | 736 RefPtr<KeyframeAnimationEffect> effect = createKeyframeAnimationEffect( |
| 737 createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0
).get(), 0), | 737 createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0
).get(), 0), |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 // Go! | 1089 // Go! |
| 1090 setCompositorForTesting(mockCompositor); | 1090 setCompositorForTesting(mockCompositor); |
| 1091 Vector<OwnPtr<blink::WebAnimation> > result; | 1091 Vector<OwnPtr<blink::WebAnimation> > result; |
| 1092 getCompositorAnimations(m_timing, *effect.get(), result); | 1092 getCompositorAnimations(m_timing, *effect.get(), result); |
| 1093 EXPECT_EQ(1U, result.size()); | 1093 EXPECT_EQ(1U, result.size()); |
| 1094 result[0].clear(); | 1094 result[0].clear(); |
| 1095 } | 1095 } |
| 1096 | 1096 |
| 1097 | 1097 |
| 1098 } // namespace WebCore | 1098 } // namespace WebCore |
| OLD | NEW |