| 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 bool impl_side_painting) { | 632 bool impl_side_painting) { |
| 634 if (threaded) { | 633 if (threaded) { |
| 635 impl_thread_.reset(new base::Thread("Compositor")); | 634 impl_thread_.reset(new base::Thread("Compositor")); |
| 636 ASSERT_TRUE(impl_thread_->Start()); | 635 ASSERT_TRUE(impl_thread_->Start()); |
| 637 } | 636 } |
| 638 | 637 |
| 639 main_task_runner_ = base::MessageLoopProxy::current(); | 638 main_task_runner_ = base::MessageLoopProxy::current(); |
| 640 | 639 |
| 641 delegating_renderer_ = delegating_renderer; | 640 delegating_renderer_ = delegating_renderer; |
| 642 | 641 |
| 643 // Spend less time waiting for BeginImplFrame because the output is | 642 // Spend less time waiting for BeginFrame because the output is |
| 644 // mocked out. | 643 // mocked out. |
| 645 settings_.refresh_rate = 200.0; | 644 settings_.refresh_rate = 200.0; |
| 646 if (impl_side_painting) { | 645 if (impl_side_painting) { |
| 647 DCHECK(threaded) | 646 DCHECK(threaded) |
| 648 << "Don't run single thread + impl side painting, it doesn't exist."; | 647 << "Don't run single thread + impl side painting, it doesn't exist."; |
| 649 settings_.impl_side_painting = true; | 648 settings_.impl_side_painting = true; |
| 650 } | 649 } |
| 651 InitializeSettings(&settings_); | 650 InitializeSettings(&settings_); |
| 652 | 651 |
| 653 main_task_runner_->PostTask( | 652 main_task_runner_->PostTask( |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 return -1; | 716 return -1; |
| 718 } | 717 } |
| 719 | 718 |
| 720 void LayerTreeTest::DestroyLayerTreeHost() { | 719 void LayerTreeTest::DestroyLayerTreeHost() { |
| 721 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 720 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
| 722 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 721 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
| 723 layer_tree_host_.reset(); | 722 layer_tree_host_.reset(); |
| 724 } | 723 } |
| 725 | 724 |
| 726 } // namespace cc | 725 } // namespace cc |
| OLD | NEW |