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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 195 } |
196 | 196 |
197 virtual void NotifyReadyToActivate() OVERRIDE { | 197 virtual void NotifyReadyToActivate() OVERRIDE { |
198 if (block_notify_ready_to_activate_for_testing_) | 198 if (block_notify_ready_to_activate_for_testing_) |
199 notify_ready_to_activate_was_blocked_ = true; | 199 notify_ready_to_activate_was_blocked_ = true; |
200 else | 200 else |
201 client_->NotifyReadyToActivate(); | 201 client_->NotifyReadyToActivate(); |
202 } | 202 } |
203 | 203 |
204 virtual void BlockNotifyReadyToActivateForTesting(bool block) OVERRIDE { | 204 virtual void BlockNotifyReadyToActivateForTesting(bool block) OVERRIDE { |
205 CHECK(settings().impl_side_painting); | |
206 CHECK(proxy()->ImplThreadTaskRunner()) | |
207 << "Not supported for single-threaded mode."; | |
208 block_notify_ready_to_activate_for_testing_ = block; | 205 block_notify_ready_to_activate_for_testing_ = block; |
209 if (!block && notify_ready_to_activate_was_blocked_) { | 206 if (!block && notify_ready_to_activate_was_blocked_) { |
210 NotifyReadyToActivate(); | 207 NotifyReadyToActivate(); |
211 notify_ready_to_activate_was_blocked_ = false; | 208 notify_ready_to_activate_was_blocked_ = false; |
212 } | 209 } |
213 } | 210 } |
214 | 211 |
215 virtual void ActivateSyncTree() OVERRIDE { | 212 virtual void ActivateSyncTree() OVERRIDE { |
216 test_hooks_->WillActivateTreeOnThread(this); | 213 test_hooks_->WillActivateTreeOnThread(this); |
217 LayerTreeHostImpl::ActivateSyncTree(); | 214 LayerTreeHostImpl::ActivateSyncTree(); |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 ASSERT_TRUE(impl_thread_->Start()); | 620 ASSERT_TRUE(impl_thread_->Start()); |
624 } | 621 } |
625 | 622 |
626 main_task_runner_ = base::MessageLoopProxy::current(); | 623 main_task_runner_ = base::MessageLoopProxy::current(); |
627 | 624 |
628 delegating_renderer_ = delegating_renderer; | 625 delegating_renderer_ = delegating_renderer; |
629 | 626 |
630 // Spend less time waiting for BeginFrame because the output is | 627 // Spend less time waiting for BeginFrame because the output is |
631 // mocked out. | 628 // mocked out. |
632 settings_.refresh_rate = 200.0; | 629 settings_.refresh_rate = 200.0; |
633 settings_.impl_side_painting = impl_side_painting; | 630 if (impl_side_painting) { |
| 631 DCHECK(threaded) |
| 632 << "Don't run single thread + impl side painting, it doesn't exist."; |
| 633 settings_.impl_side_painting = true; |
| 634 } |
634 InitializeSettings(&settings_); | 635 InitializeSettings(&settings_); |
635 | 636 |
636 main_task_runner_->PostTask( | 637 main_task_runner_->PostTask( |
637 FROM_HERE, | 638 FROM_HERE, |
638 base::Bind(&LayerTreeTest::DoBeginTest, base::Unretained(this))); | 639 base::Bind(&LayerTreeTest::DoBeginTest, base::Unretained(this))); |
639 | 640 |
640 if (timeout_seconds_) { | 641 if (timeout_seconds_) { |
641 timeout_.Reset(base::Bind(&LayerTreeTest::Timeout, base::Unretained(this))); | 642 timeout_.Reset(base::Bind(&LayerTreeTest::Timeout, base::Unretained(this))); |
642 main_task_runner_->PostDelayedTask( | 643 main_task_runner_->PostDelayedTask( |
643 FROM_HERE, | 644 FROM_HERE, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 return -1; | 698 return -1; |
698 } | 699 } |
699 | 700 |
700 void LayerTreeTest::DestroyLayerTreeHost() { | 701 void LayerTreeTest::DestroyLayerTreeHost() { |
701 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 702 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
702 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 703 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
703 layer_tree_host_.reset(); | 704 layer_tree_host_.reset(); |
704 } | 705 } |
705 | 706 |
706 } // namespace cc | 707 } // namespace cc |
OLD | NEW |