OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "cc/test/animation_timelines_test_common.h" | 5 #include "cc/test/animation_timelines_test_common.h" |
6 | 6 |
7 #include "cc/animation/animation_events.h" | 7 #include "cc/animation/animation_events.h" |
8 #include "cc/animation/animation_id_provider.h" | 8 #include "cc/animation/animation_id_provider.h" |
9 #include "cc/animation/animation_player.h" | 9 #include "cc/animation/animation_player.h" |
10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 transform_x_ = 0; | 28 transform_x_ = 0; |
29 transform_y_ = 0; | 29 transform_y_ = 0; |
30 | 30 |
31 opacity_ = 0; | 31 opacity_ = 0; |
32 brightness_ = 0; | 32 brightness_ = 0; |
33 | 33 |
34 for (int i = 0; i <= Animation::LAST_TARGET_PROPERTY; ++i) | 34 for (int i = 0; i <= Animation::LAST_TARGET_PROPERTY; ++i) |
35 mutated_properties_[i] = false; | 35 mutated_properties_[i] = false; |
36 } | 36 } |
37 | 37 |
38 TestHostClient::TestHostClient(ThreadInstance thread_instance) | 38 TestHostClient::TestHostClient() |
39 : host_(AnimationHost::Create(thread_instance)), | 39 : host_(AnimationHost::Create()), mutators_need_commit_(false) { |
40 mutators_need_commit_(false) { | |
41 host_->SetMutatorHostClient(this); | 40 host_->SetMutatorHostClient(this); |
42 } | 41 } |
43 | 42 |
44 TestHostClient::~TestHostClient() { | 43 TestHostClient::~TestHostClient() { |
45 host_->SetMutatorHostClient(nullptr); | 44 host_->SetMutatorHostClient(nullptr); |
46 } | 45 } |
47 | 46 |
48 void TestHostClient::ClearMutatedProperties() { | 47 void TestHostClient::ClearMutatedProperties() { |
49 for (auto& kv : layers_in_pending_tree_) | 48 for (auto& kv : layers_in_pending_tree_) |
50 kv.second->ClearMutatedProperties(); | 49 kv.second->ClearMutatedProperties(); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 started_ = true; | 185 started_ = true; |
187 } | 186 } |
188 void TestAnimationDelegate::NotifyAnimationFinished( | 187 void TestAnimationDelegate::NotifyAnimationFinished( |
189 base::TimeTicks monotonic_time, | 188 base::TimeTicks monotonic_time, |
190 Animation::TargetProperty target_property, | 189 Animation::TargetProperty target_property, |
191 int group) { | 190 int group) { |
192 finished_ = true; | 191 finished_ = true; |
193 } | 192 } |
194 | 193 |
195 AnimationTimelinesTest::AnimationTimelinesTest() | 194 AnimationTimelinesTest::AnimationTimelinesTest() |
196 : client_(ThreadInstance::MAIN), | 195 : client_(), |
vmpstr
2015/07/06 20:00:41
nit: You can remove these two lines now.
mlamouri (slow - plz ping)
2015/07/06 20:10:55
Done.
| |
197 client_impl_(ThreadInstance::IMPL), | 196 client_impl_(), |
198 timeline_id_(AnimationIdProvider::NextTimelineId()), | 197 timeline_id_(AnimationIdProvider::NextTimelineId()), |
199 player_id_(AnimationIdProvider::NextPlayerId()), | 198 player_id_(AnimationIdProvider::NextPlayerId()), |
200 layer_id_(1) { | 199 layer_id_(1) { |
201 host_ = client_.host(); | 200 host_ = client_.host(); |
202 host_impl_ = client_impl_.host(); | 201 host_impl_ = client_impl_.host(); |
203 } | 202 } |
204 | 203 |
205 AnimationTimelinesTest::~AnimationTimelinesTest() { | 204 AnimationTimelinesTest::~AnimationTimelinesTest() { |
206 } | 205 } |
207 | 206 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
247 } | 246 } |
248 | 247 |
249 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) { | 248 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) { |
250 const ElementAnimations* element_animations = | 249 const ElementAnimations* element_animations = |
251 host_impl_->GetElementAnimationsForLayerId(layer_id); | 250 host_impl_->GetElementAnimationsForLayerId(layer_id); |
252 return element_animations ? element_animations->players_list().head()->value() | 251 return element_animations ? element_animations->players_list().head()->value() |
253 : nullptr; | 252 : nullptr; |
254 } | 253 } |
255 | 254 |
256 } // namespace cc | 255 } // namespace cc |
OLD | NEW |