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