| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 } | 376 } |
| 377 | 377 |
| 378 void set_test_started(bool started) { test_started_ = started; } | 378 void set_test_started(bool started) { test_started_ = started; } |
| 379 | 379 |
| 380 virtual void DidDeferCommit() override { test_hooks_->DidDeferCommit(); } | 380 virtual void DidDeferCommit() override { test_hooks_->DidDeferCommit(); } |
| 381 | 381 |
| 382 private: | 382 private: |
| 383 LayerTreeHostForTesting(TestHooks* test_hooks, | 383 LayerTreeHostForTesting(TestHooks* test_hooks, |
| 384 LayerTreeHostClient* client, | 384 LayerTreeHostClient* client, |
| 385 const LayerTreeSettings& settings) | 385 const LayerTreeSettings& settings) |
| 386 : LayerTreeHost(client, NULL, settings), | 386 : LayerTreeHost(client, nullptr, settings), |
| 387 shared_bitmap_manager_(new TestSharedBitmapManager()), | 387 shared_bitmap_manager_(new TestSharedBitmapManager()), |
| 388 test_hooks_(test_hooks), | 388 test_hooks_(test_hooks), |
| 389 test_started_(false) {} | 389 test_started_(false) {} |
| 390 | 390 |
| 391 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_; | 391 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_; |
| 392 TestHooks* test_hooks_; | 392 TestHooks* test_hooks_; |
| 393 bool test_started_; | 393 bool test_started_; |
| 394 }; | 394 }; |
| 395 | 395 |
| 396 LayerTreeTest::LayerTreeTest() | 396 LayerTreeTest::LayerTreeTest() |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 | 515 |
| 516 void LayerTreeTest::DoBeginTest() { | 516 void LayerTreeTest::DoBeginTest() { |
| 517 client_ = LayerTreeHostClientForTesting::Create(this); | 517 client_ = LayerTreeHostClientForTesting::Create(this); |
| 518 | 518 |
| 519 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get()); | 519 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get()); |
| 520 layer_tree_host_ = LayerTreeHostForTesting::Create( | 520 layer_tree_host_ = LayerTreeHostForTesting::Create( |
| 521 this, | 521 this, |
| 522 client_.get(), | 522 client_.get(), |
| 523 settings_, | 523 settings_, |
| 524 base::MessageLoopProxy::current(), | 524 base::MessageLoopProxy::current(), |
| 525 impl_thread_ ? impl_thread_->message_loop_proxy() : NULL); | 525 impl_thread_ ? impl_thread_->message_loop_proxy() : nullptr); |
| 526 ASSERT_TRUE(layer_tree_host_); | 526 ASSERT_TRUE(layer_tree_host_); |
| 527 | 527 |
| 528 started_ = true; | 528 started_ = true; |
| 529 beginning_ = true; | 529 beginning_ = true; |
| 530 SetupTree(); | 530 SetupTree(); |
| 531 WillBeginTest(); | 531 WillBeginTest(); |
| 532 BeginTest(); | 532 BeginTest(); |
| 533 beginning_ = false; | 533 beginning_ = false; |
| 534 if (end_when_begin_returns_) | 534 if (end_when_begin_returns_) |
| 535 RealEndTest(); | 535 RealEndTest(); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 if (impl->pending_tree()) | 705 if (impl->pending_tree()) |
| 706 return impl->pending_tree()->source_frame_number(); | 706 return impl->pending_tree()->source_frame_number(); |
| 707 if (impl->active_tree()) | 707 if (impl->active_tree()) |
| 708 return impl->active_tree()->source_frame_number(); | 708 return impl->active_tree()->source_frame_number(); |
| 709 // Source frames start at 0, so this is invalid. | 709 // Source frames start at 0, so this is invalid. |
| 710 return -1; | 710 return -1; |
| 711 } | 711 } |
| 712 | 712 |
| 713 void LayerTreeTest::DestroyLayerTreeHost() { | 713 void LayerTreeTest::DestroyLayerTreeHost() { |
| 714 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 714 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
| 715 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 715 layer_tree_host_->root_layer()->SetLayerTreeHost(nullptr); |
| 716 layer_tree_host_ = nullptr; | 716 layer_tree_host_ = nullptr; |
| 717 } | 717 } |
| 718 | 718 |
| 719 } // namespace cc | 719 } // namespace cc |
| OLD | NEW |