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 "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "cc/test/test_shared_bitmap_manager.h" | 27 #include "cc/test/test_shared_bitmap_manager.h" |
28 #include "cc/test/test_task_graph_runner.h" | 28 #include "cc/test/test_task_graph_runner.h" |
29 #include "cc/test/tiled_layer_test_common.h" | 29 #include "cc/test/tiled_layer_test_common.h" |
30 #include "cc/trees/layer_tree_host_client.h" | 30 #include "cc/trees/layer_tree_host_client.h" |
31 #include "cc/trees/layer_tree_host_impl.h" | 31 #include "cc/trees/layer_tree_host_impl.h" |
32 #include "cc/trees/layer_tree_host_single_thread_client.h" | 32 #include "cc/trees/layer_tree_host_single_thread_client.h" |
33 #include "cc/trees/layer_tree_impl.h" | 33 #include "cc/trees/layer_tree_impl.h" |
34 #include "cc/trees/single_thread_proxy.h" | 34 #include "cc/trees/single_thread_proxy.h" |
35 #include "cc/trees/thread_proxy.h" | 35 #include "cc/trees/thread_proxy.h" |
36 #include "testing/gmock/include/gmock/gmock.h" | 36 #include "testing/gmock/include/gmock/gmock.h" |
37 #include "ui/gfx/frame_time.h" | 37 |
38 #include "ui/gfx/geometry/size_conversions.h" | 38 #include "ui/gfx/geometry/size_conversions.h" |
39 | 39 |
40 namespace cc { | 40 namespace cc { |
41 | 41 |
42 TestHooks::TestHooks() {} | 42 TestHooks::TestHooks() {} |
43 | 43 |
44 TestHooks::~TestHooks() {} | 44 TestHooks::~TestHooks() {} |
45 | 45 |
46 DrawResult TestHooks::PrepareToDrawOnThread( | 46 DrawResult TestHooks::PrepareToDrawOnThread( |
47 LayerTreeHostImpl* host_impl, | 47 LayerTreeHostImpl* host_impl, |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 void LayerTreeTest::DispatchSetNextCommitForcesRedraw() { | 779 void LayerTreeTest::DispatchSetNextCommitForcesRedraw() { |
780 DCHECK(!proxy() || proxy()->IsMainThread()); | 780 DCHECK(!proxy() || proxy()->IsMainThread()); |
781 | 781 |
782 if (layer_tree_host_) | 782 if (layer_tree_host_) |
783 layer_tree_host_->SetNextCommitForcesRedraw(); | 783 layer_tree_host_->SetNextCommitForcesRedraw(); |
784 } | 784 } |
785 | 785 |
786 void LayerTreeTest::DispatchCompositeImmediately() { | 786 void LayerTreeTest::DispatchCompositeImmediately() { |
787 DCHECK(!proxy() || proxy()->IsMainThread()); | 787 DCHECK(!proxy() || proxy()->IsMainThread()); |
788 if (layer_tree_host_) | 788 if (layer_tree_host_) |
789 layer_tree_host_->Composite(gfx::FrameTime::Now()); | 789 layer_tree_host_->Composite(base::TimeTicks::Now()); |
790 } | 790 } |
791 | 791 |
792 void LayerTreeTest::RunTest(bool threaded, | 792 void LayerTreeTest::RunTest(bool threaded, |
793 bool delegating_renderer, | 793 bool delegating_renderer, |
794 bool impl_side_painting) { | 794 bool impl_side_painting) { |
795 if (threaded) { | 795 if (threaded) { |
796 impl_thread_.reset(new base::Thread("Compositor")); | 796 impl_thread_.reset(new base::Thread("Compositor")); |
797 ASSERT_TRUE(impl_thread_->Start()); | 797 ASSERT_TRUE(impl_thread_->Start()); |
798 } | 798 } |
799 | 799 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 LayerTreeHost* LayerTreeTest::layer_tree_host() { | 891 LayerTreeHost* LayerTreeTest::layer_tree_host() { |
892 // We check for a null proxy here as we sometimes ask for the layer tree host | 892 // We check for a null proxy here as we sometimes ask for the layer tree host |
893 // when the proxy does not exist, often for checking settings after a test has | 893 // when the proxy does not exist, often for checking settings after a test has |
894 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See | 894 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See |
895 // elsewhere in this file for other examples. | 895 // elsewhere in this file for other examples. |
896 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); | 896 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); |
897 return layer_tree_host_.get(); | 897 return layer_tree_host_.get(); |
898 } | 898 } |
899 | 899 |
900 } // namespace cc | 900 } // namespace cc |
OLD | NEW |