OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layer_tree_test.h" | 5 #include "cc/test/layer_tree_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
13 #include "cc/animation/animation.h" | 13 #include "cc/animation/animation.h" |
14 #include "cc/animation/animation_host.h" | 14 #include "cc/animation/animation_host.h" |
15 #include "cc/animation/element_animations.h" | 15 #include "cc/animation/animation_player.h" |
16 #include "cc/animation/timing_function.h" | 16 #include "cc/animation/timing_function.h" |
17 #include "cc/base/switches.h" | 17 #include "cc/base/switches.h" |
18 #include "cc/blimp/remote_compositor_bridge.h" | 18 #include "cc/blimp/remote_compositor_bridge.h" |
19 #include "cc/input/input_handler.h" | 19 #include "cc/input/input_handler.h" |
20 #include "cc/layers/layer.h" | 20 #include "cc/layers/layer.h" |
21 #include "cc/layers/layer_impl.h" | 21 #include "cc/layers/layer_impl.h" |
22 #include "cc/output/buffer_to_texture_target_map.h" | 22 #include "cc/output/buffer_to_texture_target_map.h" |
23 #include "cc/test/animation_test_common.h" | 23 #include "cc/test/animation_test_common.h" |
24 #include "cc/test/begin_frame_args_test.h" | 24 #include "cc/test/begin_frame_args_test.h" |
25 #include "cc/test/fake_image_serialization_processor.h" | 25 #include "cc/test/fake_image_serialization_processor.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 bool AnimateLayers(base::TimeTicks monotonic_time) override { | 232 bool AnimateLayers(base::TimeTicks monotonic_time) override { |
233 test_hooks_->WillAnimateLayers(this, monotonic_time); | 233 test_hooks_->WillAnimateLayers(this, monotonic_time); |
234 bool result = LayerTreeHostImpl::AnimateLayers(monotonic_time); | 234 bool result = LayerTreeHostImpl::AnimateLayers(monotonic_time); |
235 test_hooks_->AnimateLayers(this, monotonic_time); | 235 test_hooks_->AnimateLayers(this, monotonic_time); |
236 return result; | 236 return result; |
237 } | 237 } |
238 | 238 |
239 void UpdateAnimationState(bool start_ready_animations) override { | 239 void UpdateAnimationState(bool start_ready_animations) override { |
240 LayerTreeHostImpl::UpdateAnimationState(start_ready_animations); | 240 LayerTreeHostImpl::UpdateAnimationState(start_ready_animations); |
241 bool has_unfinished_animation = false; | 241 bool has_unfinished_animation = false; |
242 for (const auto& it : | 242 for (const auto& it : animation_host()->active_players_for_testing()) { |
243 animation_host()->active_element_animations_for_testing()) { | 243 if (it->HasActiveAnimation()) { |
244 if (it.second->HasActiveAnimation()) { | |
245 has_unfinished_animation = true; | 244 has_unfinished_animation = true; |
246 break; | 245 break; |
247 } | 246 } |
248 } | 247 } |
249 test_hooks_->UpdateAnimationState(this, has_unfinished_animation); | 248 test_hooks_->UpdateAnimationState(this, has_unfinished_animation); |
250 } | 249 } |
251 | 250 |
252 void NotifyTileStateChanged(const Tile* tile) override { | 251 void NotifyTileStateChanged(const Tile* tile) override { |
253 LayerTreeHostImpl::NotifyTileStateChanged(tile); | 252 LayerTreeHostImpl::NotifyTileStateChanged(tile); |
254 test_hooks_->NotifyTileStateChangedOnThread(this, tile); | 253 test_hooks_->NotifyTileStateChangedOnThread(this, tile); |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 DCHECK(!IsRemoteTest()); | 922 DCHECK(!IsRemoteTest()); |
924 return layer_tree_host_in_process_; | 923 return layer_tree_host_in_process_; |
925 } | 924 } |
926 | 925 |
927 Proxy* LayerTreeTest::proxy() { | 926 Proxy* LayerTreeTest::proxy() { |
928 return layer_tree_host_in_process() ? layer_tree_host_in_process()->proxy() | 927 return layer_tree_host_in_process() ? layer_tree_host_in_process()->proxy() |
929 : NULL; | 928 : NULL; |
930 } | 929 } |
931 | 930 |
932 } // namespace cc | 931 } // namespace cc |
OLD | NEW |