OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/animation/EffectStack.h" | 5 #include "core/animation/EffectStack.h" |
6 | 6 |
7 #include "core/animation/AnimationClock.h" | 7 #include "core/animation/AnimationClock.h" |
8 #include "core/animation/CompositorPendingAnimations.h" | 8 #include "core/animation/CompositorPendingAnimations.h" |
9 #include "core/animation/DocumentTimeline.h" | 9 #include "core/animation/DocumentTimeline.h" |
10 #include "core/animation/ElementAnimations.h" | 10 #include "core/animation/ElementAnimations.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 virtual void SetUp() { | 22 virtual void SetUp() { |
23 page_holder = DummyPageHolder::Create(); | 23 page_holder = DummyPageHolder::Create(); |
24 document = &page_holder->GetDocument(); | 24 document = &page_holder->GetDocument(); |
25 document->GetAnimationClock().ResetTimeForTesting(); | 25 document->GetAnimationClock().ResetTimeForTesting(); |
26 timeline = DocumentTimeline::Create(document.Get()); | 26 timeline = DocumentTimeline::Create(document.Get()); |
27 element = document->createElement("foo"); | 27 element = document->createElement("foo"); |
28 } | 28 } |
29 | 29 |
30 Animation* Play(KeyframeEffect* effect, double start_time) { | 30 Animation* Play(KeyframeEffect* effect, double start_time) { |
31 Animation* animation = timeline->Play(effect); | 31 Animation* animation = timeline->Play(effect); |
32 animation->setStartTime(start_time * 1000); | 32 animation->setStartTime(start_time * 1000, false); |
33 animation->Update(kTimingUpdateOnDemand); | 33 animation->Update(kTimingUpdateOnDemand); |
34 return animation; | 34 return animation; |
35 } | 35 } |
36 | 36 |
37 void UpdateTimeline(double time) { | 37 void UpdateTimeline(double time) { |
38 document->GetAnimationClock().UpdateTime(document->Timeline().ZeroTime() + | 38 document->GetAnimationClock().UpdateTime(document->Timeline().ZeroTime() + |
39 time); | 39 time); |
40 timeline->ServiceAnimations(kTimingUpdateForAnimationFrame); | 40 timeline->ServiceAnimations(kTimingUpdateForAnimationFrame); |
41 } | 41 } |
42 | 42 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 interpolations = EffectStack::ActiveInterpolations( | 214 interpolations = EffectStack::ActiveInterpolations( |
215 &element->GetElementAnimations()->GetEffectStack(), nullptr, nullptr, | 215 &element->GetElementAnimations()->GetEffectStack(), nullptr, nullptr, |
216 KeyframeEffectReadOnly::kDefaultPriority); | 216 KeyframeEffectReadOnly::kDefaultPriority); |
217 EXPECT_EQ(1u, interpolations.size()); | 217 EXPECT_EQ(1u, interpolations.size()); |
218 EXPECT_TRUE(InterpolationValue(interpolations, CSSPropertyFontSize) | 218 EXPECT_TRUE(InterpolationValue(interpolations, CSSPropertyFontSize) |
219 ->Equals(AnimatableDouble::Create(3).Get())); | 219 ->Equals(AnimatableDouble::Create(3).Get())); |
220 EXPECT_EQ(1u, SampledEffectCount()); | 220 EXPECT_EQ(1u, SampledEffectCount()); |
221 } | 221 } |
222 | 222 |
223 } // namespace blink | 223 } // namespace blink |
OLD | NEW |