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 "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 342 |
343 void AnimateLayers(base::TimeTicks monotonic_time) override { | 343 void AnimateLayers(base::TimeTicks monotonic_time) override { |
344 test_hooks_->WillAnimateLayers(this, monotonic_time); | 344 test_hooks_->WillAnimateLayers(this, monotonic_time); |
345 LayerTreeHostImpl::AnimateLayers(monotonic_time); | 345 LayerTreeHostImpl::AnimateLayers(monotonic_time); |
346 test_hooks_->AnimateLayers(this, monotonic_time); | 346 test_hooks_->AnimateLayers(this, monotonic_time); |
347 } | 347 } |
348 | 348 |
349 void UpdateAnimationState(bool start_ready_animations) override { | 349 void UpdateAnimationState(bool start_ready_animations) override { |
350 LayerTreeHostImpl::UpdateAnimationState(start_ready_animations); | 350 LayerTreeHostImpl::UpdateAnimationState(start_ready_animations); |
351 bool has_unfinished_animation = false; | 351 bool has_unfinished_animation = false; |
352 AnimationRegistrar::AnimationControllerMap::const_iterator iter = | 352 for (const auto& it : |
353 active_animation_controllers().begin(); | 353 animation_registrar()->active_animation_controllers()) { |
354 for (; iter != active_animation_controllers().end(); ++iter) { | 354 if (it.second->HasActiveAnimation()) { |
355 if (iter->second->HasActiveAnimation()) { | |
356 has_unfinished_animation = true; | 355 has_unfinished_animation = true; |
357 break; | 356 break; |
358 } | 357 } |
359 } | 358 } |
360 test_hooks_->UpdateAnimationState(this, has_unfinished_animation); | 359 test_hooks_->UpdateAnimationState(this, has_unfinished_animation); |
361 } | 360 } |
362 | 361 |
363 void NotifyTileStateChanged(const Tile* tile) override { | 362 void NotifyTileStateChanged(const Tile* tile) override { |
364 LayerTreeHostImpl::NotifyTileStateChanged(tile); | 363 LayerTreeHostImpl::NotifyTileStateChanged(tile); |
365 test_hooks_->NotifyTileStateChangedOnThread(this, tile); | 364 test_hooks_->NotifyTileStateChangedOnThread(this, tile); |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 return -1; | 872 return -1; |
874 } | 873 } |
875 | 874 |
876 void LayerTreeTest::DestroyLayerTreeHost() { | 875 void LayerTreeTest::DestroyLayerTreeHost() { |
877 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 876 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
878 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 877 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
879 layer_tree_host_ = nullptr; | 878 layer_tree_host_ = nullptr; |
880 } | 879 } |
881 | 880 |
882 } // namespace cc | 881 } // namespace cc |
OLD | NEW |