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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 auto compositor_frame_sink = CreateCompositorFrameSink( | 853 auto compositor_frame_sink = CreateCompositorFrameSink( |
854 std::move(shared_context_provider), std::move(worker_context_provider)); | 854 std::move(shared_context_provider), std::move(worker_context_provider)); |
855 compositor_frame_sink->SetClient(compositor_frame_sink_client_.get()); | 855 compositor_frame_sink->SetClient(compositor_frame_sink_client_.get()); |
856 layer_tree_host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); | 856 layer_tree_host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); |
857 } | 857 } |
858 | 858 |
859 std::unique_ptr<TestCompositorFrameSink> | 859 std::unique_ptr<TestCompositorFrameSink> |
860 LayerTreeTest::CreateCompositorFrameSink( | 860 LayerTreeTest::CreateCompositorFrameSink( |
861 scoped_refptr<ContextProvider> compositor_context_provider, | 861 scoped_refptr<ContextProvider> compositor_context_provider, |
862 scoped_refptr<ContextProvider> worker_context_provider) { | 862 scoped_refptr<ContextProvider> worker_context_provider) { |
| 863 constexpr bool disable_display_vsync = false; |
863 bool synchronous_composite = | 864 bool synchronous_composite = |
864 !HasImplThread() && | 865 !HasImplThread() && |
865 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; | 866 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; |
866 return base::MakeUnique<TestCompositorFrameSink>( | 867 return base::MakeUnique<TestCompositorFrameSink>( |
867 compositor_context_provider, std::move(worker_context_provider), | 868 compositor_context_provider, std::move(worker_context_provider), |
868 shared_bitmap_manager(), gpu_memory_buffer_manager(), | 869 shared_bitmap_manager(), gpu_memory_buffer_manager(), |
869 layer_tree_host()->GetSettings().renderer_settings, impl_task_runner_, | 870 layer_tree_host()->GetSettings().renderer_settings, impl_task_runner_, |
870 synchronous_composite); | 871 synchronous_composite, disable_display_vsync); |
871 } | 872 } |
872 | 873 |
873 std::unique_ptr<OutputSurface> | 874 std::unique_ptr<OutputSurface> |
874 LayerTreeTest::CreateDisplayOutputSurfaceOnThread( | 875 LayerTreeTest::CreateDisplayOutputSurfaceOnThread( |
875 scoped_refptr<ContextProvider> compositor_context_provider) { | 876 scoped_refptr<ContextProvider> compositor_context_provider) { |
876 // By default the Display shares a context with the LayerTreeHostImpl. | 877 // By default the Display shares a context with the LayerTreeHostImpl. |
877 return FakeOutputSurface::Create3d(std::move(compositor_context_provider)); | 878 return FakeOutputSurface::Create3d(std::move(compositor_context_provider)); |
878 } | 879 } |
879 | 880 |
880 void LayerTreeTest::DestroyLayerTreeHost() { | 881 void LayerTreeTest::DestroyLayerTreeHost() { |
(...skipping 16 matching lines...) Expand all Loading... |
897 DCHECK(task_runner_provider()->IsMainThread() || | 898 DCHECK(task_runner_provider()->IsMainThread() || |
898 task_runner_provider()->IsMainThreadBlocked()); | 899 task_runner_provider()->IsMainThreadBlocked()); |
899 return layer_tree_host_.get(); | 900 return layer_tree_host_.get(); |
900 } | 901 } |
901 | 902 |
902 Proxy* LayerTreeTest::proxy() { | 903 Proxy* LayerTreeTest::proxy() { |
903 return layer_tree_host() ? layer_tree_host()->proxy() : NULL; | 904 return layer_tree_host() ? layer_tree_host()->proxy() : NULL; |
904 } | 905 } |
905 | 906 |
906 } // namespace cc | 907 } // namespace cc |
OLD | NEW |