| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 : LayerTreeHostImpl(settings, | 76 : LayerTreeHostImpl(settings, |
| 77 host_impl_client, | 77 host_impl_client, |
| 78 proxy, | 78 proxy, |
| 79 stats_instrumentation, | 79 stats_instrumentation, |
| 80 manager, | 80 manager, |
| 81 0), | 81 0), |
| 82 test_hooks_(test_hooks), | 82 test_hooks_(test_hooks), |
| 83 block_notify_ready_to_activate_for_testing_(false), | 83 block_notify_ready_to_activate_for_testing_(false), |
| 84 notify_ready_to_activate_was_blocked_(false) {} | 84 notify_ready_to_activate_was_blocked_(false) {} |
| 85 | 85 |
| 86 virtual void BeginImplFrame(const BeginFrameArgs& args) OVERRIDE { | 86 virtual void WillBeginImplFrame(const BeginFrameArgs& args) OVERRIDE { |
| 87 LayerTreeHostImpl::WillBeginImplFrame(args); |
| 87 test_hooks_->WillBeginImplFrameOnThread(this, args); | 88 test_hooks_->WillBeginImplFrameOnThread(this, args); |
| 88 LayerTreeHostImpl::BeginImplFrame(args); | |
| 89 test_hooks_->DidBeginImplFrameOnThread(this, args); | |
| 90 } | 89 } |
| 91 | 90 |
| 92 virtual void BeginMainFrameAborted(bool did_handle) OVERRIDE { | 91 virtual void BeginMainFrameAborted(bool did_handle) OVERRIDE { |
| 93 LayerTreeHostImpl::BeginMainFrameAborted(did_handle); | 92 LayerTreeHostImpl::BeginMainFrameAborted(did_handle); |
| 94 test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); | 93 test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); |
| 95 } | 94 } |
| 96 | 95 |
| 97 virtual void BeginCommit() OVERRIDE { | 96 virtual void BeginCommit() OVERRIDE { |
| 98 LayerTreeHostImpl::BeginCommit(); | 97 LayerTreeHostImpl::BeginCommit(); |
| 99 test_hooks_->BeginCommitOnThread(this); | 98 test_hooks_->BeginCommitOnThread(this); |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 bool impl_side_painting) { | 620 bool impl_side_painting) { |
| 622 if (threaded) { | 621 if (threaded) { |
| 623 impl_thread_.reset(new base::Thread("Compositor")); | 622 impl_thread_.reset(new base::Thread("Compositor")); |
| 624 ASSERT_TRUE(impl_thread_->Start()); | 623 ASSERT_TRUE(impl_thread_->Start()); |
| 625 } | 624 } |
| 626 | 625 |
| 627 main_task_runner_ = base::MessageLoopProxy::current(); | 626 main_task_runner_ = base::MessageLoopProxy::current(); |
| 628 | 627 |
| 629 delegating_renderer_ = delegating_renderer; | 628 delegating_renderer_ = delegating_renderer; |
| 630 | 629 |
| 631 // Spend less time waiting for BeginImplFrame because the output is | 630 // Spend less time waiting for BeginFrame because the output is |
| 632 // mocked out. | 631 // mocked out. |
| 633 settings_.refresh_rate = 200.0; | 632 settings_.refresh_rate = 200.0; |
| 634 if (impl_side_painting) { | 633 if (impl_side_painting) { |
| 635 DCHECK(threaded) | 634 DCHECK(threaded) |
| 636 << "Don't run single thread + impl side painting, it doesn't exist."; | 635 << "Don't run single thread + impl side painting, it doesn't exist."; |
| 637 settings_.impl_side_painting = true; | 636 settings_.impl_side_painting = true; |
| 638 } | 637 } |
| 639 InitializeSettings(&settings_); | 638 InitializeSettings(&settings_); |
| 640 | 639 |
| 641 main_task_runner_->PostTask( | 640 main_task_runner_->PostTask( |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 return -1; | 704 return -1; |
| 706 } | 705 } |
| 707 | 706 |
| 708 void LayerTreeTest::DestroyLayerTreeHost() { | 707 void LayerTreeTest::DestroyLayerTreeHost() { |
| 709 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 708 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
| 710 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 709 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
| 711 layer_tree_host_.reset(); | 710 layer_tree_host_.reset(); |
| 712 } | 711 } |
| 713 | 712 |
| 714 } // namespace cc | 713 } // namespace cc |
| OLD | NEW |