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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 } | 423 } |
424 | 424 |
425 void SetNeedsCommit() override { | 425 void SetNeedsCommit() override { |
426 if (!test_started_) | 426 if (!test_started_) |
427 return; | 427 return; |
428 LayerTreeHost::SetNeedsCommit(); | 428 LayerTreeHost::SetNeedsCommit(); |
429 } | 429 } |
430 | 430 |
431 void set_test_started(bool started) { test_started_ = started; } | 431 void set_test_started(bool started) { test_started_ = started; } |
432 | 432 |
433 void DidDeferCommit() override { test_hooks_->DidDeferCommit(); } | |
434 | |
435 private: | 433 private: |
436 LayerTreeHostForTesting(TestHooks* test_hooks, | 434 LayerTreeHostForTesting(TestHooks* test_hooks, |
437 LayerTreeHostClient* client, | 435 LayerTreeHostClient* client, |
438 const LayerTreeSettings& settings) | 436 const LayerTreeSettings& settings) |
439 : LayerTreeHost(client, NULL, NULL, settings), | 437 : LayerTreeHost(client, NULL, NULL, settings), |
440 shared_bitmap_manager_(new TestSharedBitmapManager), | 438 shared_bitmap_manager_(new TestSharedBitmapManager), |
441 gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager), | 439 gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager), |
442 test_hooks_(test_hooks), | 440 test_hooks_(test_hooks), |
443 test_started_(false) {} | 441 test_started_(false) {} |
444 | 442 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 return -1; | 788 return -1; |
791 } | 789 } |
792 | 790 |
793 void LayerTreeTest::DestroyLayerTreeHost() { | 791 void LayerTreeTest::DestroyLayerTreeHost() { |
794 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 792 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
795 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 793 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
796 layer_tree_host_ = nullptr; | 794 layer_tree_host_ = nullptr; |
797 } | 795 } |
798 | 796 |
799 } // namespace cc | 797 } // namespace cc |
OLD | NEW |