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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 bool synchronous_composite = | 798 bool synchronous_composite = |
799 !HasImplThread() && | 799 !HasImplThread() && |
800 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; | 800 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; |
801 // Disable reclaim resources by default to act like the Display lives | 801 // Disable reclaim resources by default to act like the Display lives |
802 // out-of-process. | 802 // out-of-process. |
803 bool force_disable_reclaim_resources = true; | 803 bool force_disable_reclaim_resources = true; |
804 return base::MakeUnique<TestCompositorFrameSink>( | 804 return base::MakeUnique<TestCompositorFrameSink>( |
805 compositor_context_provider, std::move(worker_context_provider), | 805 compositor_context_provider, std::move(worker_context_provider), |
806 CreateDisplayOutputSurface(compositor_context_provider), | 806 CreateDisplayOutputSurface(compositor_context_provider), |
807 shared_bitmap_manager(), gpu_memory_buffer_manager(), | 807 shared_bitmap_manager(), gpu_memory_buffer_manager(), |
808 layer_tree_host()->GetSettings().renderer_settings, | 808 layer_tree_host()->GetSettings().renderer_settings, impl_task_runner_, |
809 ImplThreadTaskRunner(), synchronous_composite, | 809 synchronous_composite, force_disable_reclaim_resources); |
810 force_disable_reclaim_resources); | |
811 } | 810 } |
812 | 811 |
813 std::unique_ptr<OutputSurface> LayerTreeTest::CreateDisplayOutputSurface( | 812 std::unique_ptr<OutputSurface> LayerTreeTest::CreateDisplayOutputSurface( |
814 scoped_refptr<ContextProvider> compositor_context_provider) { | 813 scoped_refptr<ContextProvider> compositor_context_provider) { |
815 // By default the Display shares a context with the LayerTreeHostImpl. | 814 // By default the Display shares a context with the LayerTreeHostImpl. |
816 return FakeOutputSurface::Create3d(std::move(compositor_context_provider)); | 815 return FakeOutputSurface::Create3d(std::move(compositor_context_provider)); |
817 } | 816 } |
818 | 817 |
819 void LayerTreeTest::DestroyLayerTreeHost() { | 818 void LayerTreeTest::DestroyLayerTreeHost() { |
820 if (layer_tree_host_ && layer_tree_host_->GetLayerTree()->root_layer()) | 819 if (layer_tree_host_ && layer_tree_host_->GetLayerTree()->root_layer()) |
(...skipping 17 matching lines...) Expand all Loading... |
838 return layer_tree_host_.get(); | 837 return layer_tree_host_.get(); |
839 } | 838 } |
840 | 839 |
841 LayerTreeHostInProcess* LayerTreeTest::layer_tree_host_in_process() { | 840 LayerTreeHostInProcess* LayerTreeTest::layer_tree_host_in_process() { |
842 DCHECK(task_runner_provider()->IsMainThread() || | 841 DCHECK(task_runner_provider()->IsMainThread() || |
843 task_runner_provider()->IsMainThreadBlocked()); | 842 task_runner_provider()->IsMainThreadBlocked()); |
844 DCHECK(!IsRemoteTest()); | 843 DCHECK(!IsRemoteTest()); |
845 return layer_tree_host_.get(); | 844 return layer_tree_host_.get(); |
846 } | 845 } |
847 } // namespace cc | 846 } // namespace cc |
OLD | NEW |