| 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 BeginFrame(const BeginFrameArgs& args) OVERRIDE { |
| 87 test_hooks_->WillBeginImplFrameOnThread(this, args); | 87 test_hooks_->WillBeginFrameOnThread(this, args); |
| 88 LayerTreeHostImpl::BeginImplFrame(args); | 88 LayerTreeHostImpl::BeginFrame(args); |
| 89 test_hooks_->DidBeginImplFrameOnThread(this, args); | 89 test_hooks_->DidBeginFrameOnThread(this, args); |
| 90 } | 90 } |
| 91 | 91 |
| 92 virtual void BeginMainFrameAborted(bool did_handle) OVERRIDE { | 92 virtual void BeginMainFrameAborted(bool did_handle) OVERRIDE { |
| 93 LayerTreeHostImpl::BeginMainFrameAborted(did_handle); | 93 LayerTreeHostImpl::BeginMainFrameAborted(did_handle); |
| 94 test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); | 94 test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); |
| 95 } | 95 } |
| 96 | 96 |
| 97 virtual void BeginCommit() OVERRIDE { | 97 virtual void BeginCommit() OVERRIDE { |
| 98 LayerTreeHostImpl::BeginCommit(); | 98 LayerTreeHostImpl::BeginCommit(); |
| 99 test_hooks_->BeginCommitOnThread(this); | 99 test_hooks_->BeginCommitOnThread(this); |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 bool impl_side_painting) { | 633 bool impl_side_painting) { |
| 634 if (threaded) { | 634 if (threaded) { |
| 635 impl_thread_.reset(new base::Thread("Compositor")); | 635 impl_thread_.reset(new base::Thread("Compositor")); |
| 636 ASSERT_TRUE(impl_thread_->Start()); | 636 ASSERT_TRUE(impl_thread_->Start()); |
| 637 } | 637 } |
| 638 | 638 |
| 639 main_task_runner_ = base::MessageLoopProxy::current(); | 639 main_task_runner_ = base::MessageLoopProxy::current(); |
| 640 | 640 |
| 641 delegating_renderer_ = delegating_renderer; | 641 delegating_renderer_ = delegating_renderer; |
| 642 | 642 |
| 643 // Spend less time waiting for BeginImplFrame because the output is | 643 // Spend less time waiting for BeginFrame because the output is |
| 644 // mocked out. | 644 // mocked out. |
| 645 settings_.refresh_rate = 200.0; | 645 settings_.refresh_rate = 200.0; |
| 646 if (impl_side_painting) { | 646 if (impl_side_painting) { |
| 647 DCHECK(threaded) | 647 DCHECK(threaded) |
| 648 << "Don't run single thread + impl side painting, it doesn't exist."; | 648 << "Don't run single thread + impl side painting, it doesn't exist."; |
| 649 settings_.impl_side_painting = true; | 649 settings_.impl_side_painting = true; |
| 650 } | 650 } |
| 651 InitializeSettings(&settings_); | 651 InitializeSettings(&settings_); |
| 652 | 652 |
| 653 main_task_runner_->PostTask( | 653 main_task_runner_->PostTask( |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 return -1; | 717 return -1; |
| 718 } | 718 } |
| 719 | 719 |
| 720 void LayerTreeTest::DestroyLayerTreeHost() { | 720 void LayerTreeTest::DestroyLayerTreeHost() { |
| 721 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 721 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
| 722 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 722 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
| 723 layer_tree_host_.reset(); | 723 layer_tree_host_.reset(); |
| 724 } | 724 } |
| 725 | 725 |
| 726 } // namespace cc | 726 } // namespace cc |
| OLD | NEW |