From c44437a22b4b75aa2b780ddb8f8adb562844d994 Mon Sep 17 00:00:00 2001 From: piman Date: Fri, 28 Oct 2016 17:09:22 -0700 Subject: [PATCH] Move GpuMemoryBufferManager and SharedBitmapManager to CompositorFrameSink They're only used by the ResourceProvider, so there's no fundamental reason for them to take a separate path through the compositor. Besides, it is natural that the CompositorFrameSink contains all the objects needed to create resources, all at the same place. Finally, it's less code overall. BUG=None CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel Review-Url: https://codereview.chromium.org/2452483002 Cr-Commit-Position: refs/heads/master@{#428551} --- .../core/compositor/blimp_compositor.cc | 7 +- .../compositor/blimp_compositor_frame_sink.cc | 6 +- .../compositor/blimp_compositor_frame_sink.h | 2 + .../blimp_compositor_frame_sink_unittest.cc | 4 +- .../compositor/blimp_embedder_compositor.cc | 8 +- .../micro_benchmark_controller_unittest.cc | 4 +- ...rowser_controls_offset_manager_unittest.cc | 3 - cc/input/scroll_state_unittest.cc | 4 +- ...imation_controller_linear_fade_unittest.cc | 3 - ..._animation_controller_thinning_unittest.cc | 3 - .../heads_up_display_layer_impl_unittest.cc | 5 +- cc/layers/layer_impl_unittest.cc | 15 +--- cc/layers/layer_iterator_unittest.cc | 6 +- cc/layers/layer_list_iterator_unittest.cc | 17 +---- cc/layers/layer_perftest.cc | 5 +- cc/layers/layer_unittest.cc | 8 -- cc/layers/layer_utils_unittest.cc | 6 +- cc/layers/nine_patch_layer_impl_unittest.cc | 10 +-- cc/layers/picture_layer_impl_perftest.cc | 3 - cc/layers/picture_layer_impl_unittest.cc | 1 - cc/layers/picture_layer_unittest.cc | 28 ++----- cc/layers/render_surface_unittest.cc | 13 +--- cc/layers/scrollbar_layer_unittest.cc | 4 +- cc/layers/solid_color_layer_impl_unittest.cc | 12 +-- cc/layers/texture_layer_unittest.cc | 1 - cc/layers/ui_resource_layer_impl_unittest.cc | 16 ++-- cc/output/compositor_frame_sink.cc | 12 ++- cc/output/compositor_frame_sink.h | 23 +++++- cc/output/compositor_frame_sink_unittest.cc | 4 +- cc/surfaces/direct_compositor_frame_sink.cc | 8 +- cc/surfaces/direct_compositor_frame_sink.h | 4 +- .../direct_compositor_frame_sink_unittest.cc | 3 +- cc/test/fake_compositor_frame_sink.cc | 11 ++- cc/test/fake_compositor_frame_sink.h | 5 ++ cc/test/fake_layer_tree_host.cc | 1 - cc/test/fake_layer_tree_host.h | 2 - cc/test/fake_layer_tree_host_impl.cc | 21 +----- cc/test/fake_layer_tree_host_impl.h | 7 -- .../fake_ui_resource_layer_tree_host_impl.cc | 3 +- .../fake_ui_resource_layer_tree_host_impl.h | 1 - cc/test/layer_tree_host_remote_for_testing.cc | 16 +--- cc/test/layer_tree_host_remote_for_testing.h | 8 +- cc/test/layer_tree_json_parser_unittest.cc | 8 +- cc/test/layer_tree_test.cc | 37 ++-------- cc/test/layer_tree_test.h | 1 - cc/test/test_compositor_frame_sink.cc | 8 +- cc/test/test_compositor_frame_sink.h | 2 - cc/test/test_layer_tree_host_base.cc | 12 +-- cc/test/test_layer_tree_host_base.h | 8 +- cc/tiles/picture_layer_tiling_unittest.cc | 1 - cc/tiles/tile_manager_perftest.cc | 1 - cc/tiles/tile_manager_unittest.cc | 22 ++---- cc/trees/damage_tracker_unittest.cc | 6 +- cc/trees/layer_tree_host_common_unittest.cc | 73 +++++-------------- cc/trees/layer_tree_host_impl.cc | 14 +--- cc/trees/layer_tree_host_impl.h | 6 -- cc/trees/layer_tree_host_impl_unittest.cc | 40 ++++------ cc/trees/layer_tree_host_in_process.cc | 7 +- cc/trees/layer_tree_host_in_process.h | 21 +----- cc/trees/layer_tree_host_pixeltest_tiles.cc | 1 - cc/trees/layer_tree_host_unittest.cc | 1 - cc/trees/layer_tree_host_unittest_scroll.cc | 3 - cc/trees/tree_synchronizer_unittest.cc | 4 - .../gpu_process_transport_factory.cc | 11 +-- .../gpu_process_transport_factory.h | 1 - .../mus_browser_compositor_output_surface.cc | 4 +- .../mus_browser_compositor_output_surface.h | 5 ++ .../renderer_host/compositor_impl_android.cc | 16 ++-- .../context_provider_factory_impl_android.cc | 4 - .../context_provider_factory_impl_android.h | 1 - .../synchronous_compositor_frame_sink.cc | 5 +- .../synchronous_compositor_frame_sink.h | 1 + .../renderer/gpu/compositor_dependencies.h | 7 -- .../renderer/gpu/render_widget_compositor.cc | 3 - .../gpu/renderer_compositor_frame_sink.cc | 6 +- .../gpu/renderer_compositor_frame_sink.h | 2 + content/renderer/layout_test_dependencies.h | 3 + .../mus/render_widget_mus_connection.cc | 5 +- .../mus/render_widget_mus_connection.h | 4 +- content/renderer/render_thread_impl.cc | 15 ++-- content/renderer/render_thread_impl.h | 3 +- content/test/fake_compositor_dependencies.cc | 9 --- content/test/fake_compositor_dependencies.h | 6 -- content/test/layouttest_support.cc | 8 +- services/ui/demo/bitmap_uploader.cc | 6 +- services/ui/demo/bitmap_uploader.h | 4 +- services/ui/public/cpp/window.cc | 4 +- services/ui/public/cpp/window.h | 7 +- .../cpp/window_compositor_frame_sink.cc | 10 ++- .../public/cpp/window_compositor_frame_sink.h | 2 + .../graphics/CompositorMutableStateTest.cpp | 2 - ui/android/context_provider_factory.h | 3 - ui/compositor/compositor.cc | 3 - ui/compositor/compositor.h | 5 -- .../test/in_process_context_factory.cc | 10 +-- .../test/in_process_context_factory.h | 1 - ui/views/mus/surface_context_factory.cc | 11 +-- ui/views/mus/surface_context_factory.h | 1 - 98 files changed, 273 insertions(+), 514 deletions(-) diff --git a/blimp/client/core/compositor/blimp_compositor.cc b/blimp/client/core/compositor/blimp_compositor.cc index 2866c44682eebb..54dc7aaf78f0a9 100644 --- a/blimp/client/core/compositor/blimp_compositor.cc +++ b/blimp/client/core/compositor/blimp_compositor.cc @@ -241,8 +241,9 @@ void BlimpCompositor::OnContextProvidersCreated( auto compositor_frame_sink = base::MakeUnique( std::move(compositor_context_provider), - std::move(worker_context_provider), base::ThreadTaskRunnerHandle::Get(), - weak_ptr_factory_.GetWeakPtr()); + std::move(worker_context_provider), + GetEmbedderDeps()->GetGpuMemoryBufferManager(), nullptr, + base::ThreadTaskRunnerHandle::Get(), weak_ptr_factory_.GetWeakPtr()); host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); } @@ -363,8 +364,6 @@ void BlimpCompositor::CreateLayerTreeHost() { cc::LayerTreeHostInProcess::InitParams params; params.client = this; params.task_graph_runner = compositor_dependencies_->GetTaskGraphRunner(); - params.gpu_memory_buffer_manager = - GetEmbedderDeps()->GetGpuMemoryBufferManager(); params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); if (!use_threaded_layer_tree_host_) { params.image_serialization_processor = diff --git a/blimp/client/core/compositor/blimp_compositor_frame_sink.cc b/blimp/client/core/compositor/blimp_compositor_frame_sink.cc index de57040cde7c06..a8edcceb9c9877 100644 --- a/blimp/client/core/compositor/blimp_compositor_frame_sink.cc +++ b/blimp/client/core/compositor/blimp_compositor_frame_sink.cc @@ -21,10 +21,14 @@ namespace client { BlimpCompositorFrameSink::BlimpCompositorFrameSink( scoped_refptr compositor_context_provider, scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + cc::SharedBitmapManager* shared_bitmap_manager, scoped_refptr main_task_runner, base::WeakPtr main_thread_proxy) : cc::CompositorFrameSink(std::move(compositor_context_provider), - std::move(worker_context_provider)), + std::move(worker_context_provider), + gpu_memory_buffer_manager, + shared_bitmap_manager), main_task_runner_(std::move(main_task_runner)), main_thread_proxy_(main_thread_proxy), weak_factory_(this) { diff --git a/blimp/client/core/compositor/blimp_compositor_frame_sink.h b/blimp/client/core/compositor/blimp_compositor_frame_sink.h index 85ff292b3200f7..75a8dfb22e6c33 100644 --- a/blimp/client/core/compositor/blimp_compositor_frame_sink.h +++ b/blimp/client/core/compositor/blimp_compositor_frame_sink.h @@ -32,6 +32,8 @@ class BlimpCompositorFrameSink : public cc::CompositorFrameSink, BlimpCompositorFrameSink( scoped_refptr compositor_context_provider, scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + cc::SharedBitmapManager* shared_bitmap_manager, scoped_refptr main_task_runner, base::WeakPtr main_thread_proxy); diff --git a/blimp/client/core/compositor/blimp_compositor_frame_sink_unittest.cc b/blimp/client/core/compositor/blimp_compositor_frame_sink_unittest.cc index e1bd2fa451b27a..3b135879dbdf26 100644 --- a/blimp/client/core/compositor/blimp_compositor_frame_sink_unittest.cc +++ b/blimp/client/core/compositor/blimp_compositor_frame_sink_unittest.cc @@ -115,8 +115,8 @@ class BlimpCompositorFrameSinkTest : public testing::Test { main_thread_proxy_ = base::MakeUnique( compositor_task_runner_); compositor_frame_sink_ = base::MakeUnique( - TestContextProvider::Create(bind_should_fail), nullptr, - main_task_runner_, main_thread_proxy_->GetWeakPtr()); + TestContextProvider::Create(bind_should_fail), nullptr, nullptr, + nullptr, main_task_runner_, main_thread_proxy_->GetWeakPtr()); base::WaitableEvent init_event( base::WaitableEvent::ResetPolicy::AUTOMATIC, diff --git a/blimp/client/support/compositor/blimp_embedder_compositor.cc b/blimp/client/support/compositor/blimp_embedder_compositor.cc index c4fe2f6db35ba3..31c3931f0b7b38 100644 --- a/blimp/client/support/compositor/blimp_embedder_compositor.cc +++ b/blimp/client/support/compositor/blimp_embedder_compositor.cc @@ -117,8 +117,6 @@ BlimpEmbedderCompositor::BlimpEmbedderCompositor( cc::LayerTreeHostInProcess::InitParams params; params.client = this; - params.gpu_memory_buffer_manager = - compositor_dependencies_->GetGpuMemoryBufferManager(); params.task_graph_runner = g_task_graph_runner.Pointer(); cc::LayerTreeSettings settings; params.settings = &settings; @@ -203,6 +201,7 @@ void BlimpEmbedderCompositor::HandlePendingCompositorFrameSinkRequest() { gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = compositor_dependencies_->GetGpuMemoryBufferManager(); + cc::SharedBitmapManager* shared_bitmap_manager = nullptr; auto task_runner = base::ThreadTaskRunnerHandle::Get(); auto display_output_surface = @@ -216,7 +215,7 @@ void BlimpEmbedderCompositor::HandlePendingCompositorFrameSinkRequest() { display_output_surface->capabilities().max_frames_pending)); display_ = base::MakeUnique( - nullptr /*shared_bitmap_manager*/, gpu_memory_buffer_manager, + shared_bitmap_manager, gpu_memory_buffer_manager, host_->GetSettings().renderer_settings, std::move(begin_frame_source), std::move(display_output_surface), std::move(scheduler), base::MakeUnique(task_runner.get())); @@ -226,7 +225,8 @@ void BlimpEmbedderCompositor::HandlePendingCompositorFrameSinkRequest() { // The Browser compositor and display share the same context provider. auto compositor_frame_sink = base::MakeUnique( frame_sink_id_, compositor_dependencies_->GetSurfaceManager(), - display_.get(), context_provider_, nullptr); + display_.get(), context_provider_, nullptr, gpu_memory_buffer_manager, + shared_bitmap_manager); host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); } diff --git a/cc/debug/micro_benchmark_controller_unittest.cc b/cc/debug/micro_benchmark_controller_unittest.cc index 99867775805880..e5a716fd59066b 100644 --- a/cc/debug/micro_benchmark_controller_unittest.cc +++ b/cc/debug/micro_benchmark_controller_unittest.cc @@ -27,8 +27,7 @@ class MicroBenchmarkControllerTest : public testing::Test { impl_task_runner_provider_ = base::WrapUnique(new FakeImplTaskRunnerProvider); layer_tree_host_impl_ = base::MakeUnique( - impl_task_runner_provider_.get(), &shared_bitmap_manager_, - &task_graph_runner_); + impl_task_runner_provider_.get(), &task_graph_runner_); layer_tree_host_ = FakeLayerTreeHost::Create(&layer_tree_host_client_, &task_graph_runner_); @@ -46,7 +45,6 @@ class MicroBenchmarkControllerTest : public testing::Test { FakeLayerTreeHostClient layer_tree_host_client_; TestTaskGraphRunner task_graph_runner_; - TestSharedBitmapManager shared_bitmap_manager_; std::unique_ptr layer_tree_host_; std::unique_ptr layer_tree_host_impl_; std::unique_ptr impl_task_runner_provider_; diff --git a/cc/input/browser_controls_offset_manager_unittest.cc b/cc/input/browser_controls_offset_manager_unittest.cc index 1fc7498068c7fa..f3464b28714397 100644 --- a/cc/input/browser_controls_offset_manager_unittest.cc +++ b/cc/input/browser_controls_offset_manager_unittest.cc @@ -14,7 +14,6 @@ #include "cc/layers/layer_impl.h" #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host_impl.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/layer_tree_impl.h" #include "testing/gtest/include/gtest/gtest.h" @@ -30,7 +29,6 @@ class MockBrowserControlsOffsetManagerClient float browser_controls_show_threshold, float browser_controls_hide_threshold) : host_impl_(&task_runner_provider_, - &shared_bitmap_manager_, &task_graph_runner_), redraw_needed_(false), update_draw_properties_needed_(false), @@ -92,7 +90,6 @@ class MockBrowserControlsOffsetManagerClient private: FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; FakeLayerTreeHostImpl host_impl_; std::unique_ptr active_tree_; diff --git a/cc/input/scroll_state_unittest.cc b/cc/input/scroll_state_unittest.cc index 1a3a8965ad96d9..0da54d17ffad15 100644 --- a/cc/input/scroll_state_unittest.cc +++ b/cc/input/scroll_state_unittest.cc @@ -63,10 +63,8 @@ TEST_F(ScrollStateTest, CurrentNativeScrollingScrollable) { ScrollState scroll_state(scroll_state_data); FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr layer_impl = LayerImpl::Create(host_impl.active_tree(), 1); diff --git a/cc/input/scrollbar_animation_controller_linear_fade_unittest.cc b/cc/input/scrollbar_animation_controller_linear_fade_unittest.cc index d4c4df22ac1a76..06c4aa98dfa069 100644 --- a/cc/input/scrollbar_animation_controller_linear_fade_unittest.cc +++ b/cc/input/scrollbar_animation_controller_linear_fade_unittest.cc @@ -8,7 +8,6 @@ #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host_impl.h" #include "cc/test/geometry_test_utils.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/layer_tree_impl.h" #include "testing/gtest/include/gtest/gtest.h" @@ -22,7 +21,6 @@ class ScrollbarAnimationControllerLinearFadeTest public: ScrollbarAnimationControllerLinearFadeTest() : host_impl_(&task_runner_provider_, - &shared_bitmap_manager_, &task_graph_runner_), did_request_redraw_(false), did_request_animate_(false) {} @@ -79,7 +77,6 @@ class ScrollbarAnimationControllerLinearFadeTest virtual ScrollbarOrientation orientation() const { return HORIZONTAL; } FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; FakeLayerTreeHostImpl host_impl_; std::unique_ptr scrollbar_controller_; diff --git a/cc/input/scrollbar_animation_controller_thinning_unittest.cc b/cc/input/scrollbar_animation_controller_thinning_unittest.cc index de54ff983920b6..e32680d98933ef 100644 --- a/cc/input/scrollbar_animation_controller_thinning_unittest.cc +++ b/cc/input/scrollbar_animation_controller_thinning_unittest.cc @@ -8,7 +8,6 @@ #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host_impl.h" #include "cc/test/geometry_test_utils.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/layer_tree_impl.h" #include "testing/gtest/include/gtest/gtest.h" @@ -27,7 +26,6 @@ class ScrollbarAnimationControllerThinningTest public: ScrollbarAnimationControllerThinningTest() : host_impl_(&task_runner_provider_, - &shared_bitmap_manager_, &task_graph_runner_) {} void PostDelayedScrollbarAnimationTask(const base::Closure& start_fade, @@ -89,7 +87,6 @@ class ScrollbarAnimationControllerThinningTest } FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; FakeLayerTreeHostImpl host_impl_; std::unique_ptr scrollbar_controller_; diff --git a/cc/layers/heads_up_display_layer_impl_unittest.cc b/cc/layers/heads_up_display_layer_impl_unittest.cc index 201f387ad4f890..722e5615fc8705 100644 --- a/cc/layers/heads_up_display_layer_impl_unittest.cc +++ b/cc/layers/heads_up_display_layer_impl_unittest.cc @@ -9,7 +9,6 @@ #include "cc/test/fake_compositor_frame_sink.h" #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host_impl.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/layer_tree_impl.h" #include "testing/gtest/include/gtest/gtest.h" @@ -35,12 +34,10 @@ void CheckDrawLayer(HeadsUpDisplayLayerImpl* layer, TEST(HeadsUpDisplayLayerImplTest, ResourcelessSoftwareDrawAfterResourceLoss) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.CreatePendingTree(); host_impl.SetVisible(true); host_impl.InitializeRenderer(compositor_frame_sink.get()); diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc index 63889d975a2330..ebc0cd352d98f0 100644 --- a/cc/layers/layer_impl_unittest.cc +++ b/cc/layers/layer_impl_unittest.cc @@ -14,7 +14,6 @@ #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host_impl.h" #include "cc/test/geometry_test_utils.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/layer_tree_impl.h" #include "cc/trees/single_thread_proxy.h" @@ -124,12 +123,10 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) { // The constructor on this will fake that we are on the correct thread. // Create a simple LayerImpl tree: FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.SetVisible(true); EXPECT_TRUE(host_impl.InitializeRenderer(compositor_frame_sink.get())); std::unique_ptr root_clip_ptr = @@ -244,12 +241,10 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) { TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.SetVisible(true); EXPECT_TRUE(host_impl.InitializeRenderer(compositor_frame_sink.get())); host_impl.active_tree()->SetRootLayerForTesting( @@ -374,12 +369,10 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) { TEST(LayerImplTest, SafeOpaqueBackgroundColor) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.SetVisible(true); EXPECT_TRUE(host_impl.InitializeRenderer(compositor_frame_sink.get())); host_impl.active_tree()->SetRootLayerForTesting( @@ -417,7 +410,6 @@ class LayerImplScrollTest : public testing::Test { LayerImplScrollTest() : host_impl_(settings(), &task_runner_provider_, - &shared_bitmap_manager_, &task_graph_runner_), root_id_(7) { host_impl_.active_tree()->SetRootLayerForTesting( @@ -460,7 +452,6 @@ class LayerImplScrollTest : public testing::Test { private: FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; FakeLayerTreeHostImpl host_impl_; int root_id_; diff --git a/cc/layers/layer_iterator_unittest.cc b/cc/layers/layer_iterator_unittest.cc index eb7db0754d46aa..ea51d6fd735045 100644 --- a/cc/layers/layer_iterator_unittest.cc +++ b/cc/layers/layer_iterator_unittest.cc @@ -94,10 +94,7 @@ void IterateFrontToBack(LayerImplList* render_surface_layer_list) { class LayerIteratorTest : public testing::Test { public: LayerIteratorTest() - : host_impl_(&task_runner_provider_, - &shared_bitmap_manager_, - &task_graph_runner_), - id_(1) {} + : host_impl_(&task_runner_provider_, &task_graph_runner_), id_(1) {} std::unique_ptr CreateLayer() { return TestLayerImpl::Create(host_impl_.active_tree(), id_++); @@ -105,7 +102,6 @@ class LayerIteratorTest : public testing::Test { protected: FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; FakeLayerTreeHostImpl host_impl_; diff --git a/cc/layers/layer_list_iterator_unittest.cc b/cc/layers/layer_list_iterator_unittest.cc index d69a9ff959cff5..048b33abdc5b20 100644 --- a/cc/layers/layer_list_iterator_unittest.cc +++ b/cc/layers/layer_list_iterator_unittest.cc @@ -11,7 +11,6 @@ #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host.h" #include "cc/test/fake_layer_tree_host_impl.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/layer_tree_impl.h" #include "testing/gtest/include/gtest/gtest.h" @@ -198,12 +197,10 @@ TEST(LayerListReverseIteratorTest, VerifyNullFirstLayer) { TEST(LayerListIteratorTest, VerifyTraversalOrderImpl) { // Unfortunate preamble. FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.SetVisible(true); EXPECT_TRUE(host_impl.InitializeRenderer(compositor_frame_sink.get())); @@ -253,12 +250,10 @@ TEST(LayerListIteratorTest, VerifyTraversalOrderImpl) { TEST(LayerListIteratorTest, VerifySingleLayerImpl) { // Unfortunate preamble. FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.SetVisible(true); EXPECT_TRUE(host_impl.InitializeRenderer(compositor_frame_sink.get())); @@ -290,12 +285,10 @@ TEST(LayerListIteratorTest, VerifyNullFirstLayerImpl) { TEST(LayerListReverseIteratorTest, VerifyTraversalOrderImpl) { // Unfortunate preamble. FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.SetVisible(true); EXPECT_TRUE(host_impl.InitializeRenderer(compositor_frame_sink.get())); @@ -347,12 +340,10 @@ TEST(LayerListReverseIteratorTest, VerifyTraversalOrderImpl) { TEST(LayerListReverseIteratorTest, VerifySingleLayerImpl) { // Unfortunate preamble. FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.SetVisible(true); EXPECT_TRUE(host_impl.InitializeRenderer(compositor_frame_sink.get())); diff --git a/cc/layers/layer_perftest.cc b/cc/layers/layer_perftest.cc index df5e52636b2394..09e6c1e2b689a9 100644 --- a/cc/layers/layer_perftest.cc +++ b/cc/layers/layer_perftest.cc @@ -25,9 +25,7 @@ static const int kTimeCheckInterval = 10; class LayerPerfTest : public testing::Test { public: LayerPerfTest() - : host_impl_(&task_runner_provider_, - &shared_bitmap_manager_, - &task_graph_runner_), + : host_impl_(&task_runner_provider_, &task_graph_runner_), timer_(kWarmupRuns, base::TimeDelta::FromMilliseconds(kTimeLimitMillis), kTimeCheckInterval) {} @@ -46,7 +44,6 @@ class LayerPerfTest : public testing::Test { } FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; FakeLayerTreeHostImpl host_impl_; diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc index 303464c575519e..44f25e3f289dcf 100644 --- a/cc/layers/layer_unittest.cc +++ b/cc/layers/layer_unittest.cc @@ -27,8 +27,6 @@ #include "cc/test/layer_internals_for_test.h" #include "cc/test/layer_test_common.h" #include "cc/test/stub_layer_tree_host_single_thread_client.h" -#include "cc/test/test_gpu_memory_buffer_manager.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/layer_tree_host.h" #include "cc/trees/single_thread_proxy.h" @@ -902,7 +900,6 @@ class LayerTest : public testing::Test { LayerTest() : host_impl_(LayerTreeSettings(), &task_runner_provider_, - &shared_bitmap_manager_, &task_graph_runner_) { timeline_impl_ = AnimationTimeline::Create(AnimationIdProvider::NextTimelineId()); @@ -992,7 +989,6 @@ class LayerTest : public testing::Test { } FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; FakeLayerTreeHostImpl host_impl_; @@ -1825,9 +1821,7 @@ class LayerTreeHostFactory { std::unique_ptr Create(LayerTreeSettings settings) { LayerTreeHostInProcess::InitParams params; params.client = &client_; - params.shared_bitmap_manager = &shared_bitmap_manager_; params.task_graph_runner = &task_graph_runner_; - params.gpu_memory_buffer_manager = &gpu_memory_buffer_manager_; params.settings = &settings; params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); params.animation_host = @@ -1839,9 +1833,7 @@ class LayerTreeHostFactory { private: FakeLayerTreeHostClient client_; StubLayerTreeHostSingleThreadClient single_thread_client_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; - TestGpuMemoryBufferManager gpu_memory_buffer_manager_; }; void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) { diff --git a/cc/layers/layer_utils_unittest.cc b/cc/layers/layer_utils_unittest.cc index b00404cf9e777b..119ce90ea9a8a9 100644 --- a/cc/layers/layer_utils_unittest.cc +++ b/cc/layers/layer_utils_unittest.cc @@ -11,7 +11,6 @@ #include "cc/test/animation_test_common.h" #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host_impl.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_impl.h" @@ -29,9 +28,7 @@ float diagonal(float width, float height) { class LayerUtilsGetAnimationBoundsTest : public testing::Test { public: LayerUtilsGetAnimationBoundsTest() - : host_impl_(&task_runner_provider_, - &shared_bitmap_manager_, - &task_graph_runner_), + : host_impl_(&task_runner_provider_, &task_graph_runner_), root_(CreateTwoForkTree(&host_impl_)), parent1_(root_->test_properties()->children[0]), parent2_(root_->test_properties()->children[1]), @@ -88,7 +85,6 @@ class LayerUtilsGetAnimationBoundsTest : public testing::Test { } FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; FakeLayerTreeHostImpl host_impl_; LayerImpl* root_; diff --git a/cc/layers/nine_patch_layer_impl_unittest.cc b/cc/layers/nine_patch_layer_impl_unittest.cc index 0fe9bf20f55696..9f7bcf46093936 100644 --- a/cc/layers/nine_patch_layer_impl_unittest.cc +++ b/cc/layers/nine_patch_layer_impl_unittest.cc @@ -44,12 +44,11 @@ void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size, layer_size.height() - border.height()); FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeUIResourceLayerTreeHostImpl host_impl( - &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); + FakeUIResourceLayerTreeHostImpl host_impl(&task_runner_provider, + &task_graph_runner); host_impl.SetVisible(true); host_impl.InitializeRenderer(compositor_frame_sink.get()); @@ -149,12 +148,11 @@ void NinePatchLayerLayoutTestWithOcclusion(const gfx::Size& bitmap_size, bitmap_size.height() - image_remaining_bottom - image_remaining_top); FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeUIResourceLayerTreeHostImpl host_impl( - &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); + FakeUIResourceLayerTreeHostImpl host_impl(&task_runner_provider, + &task_graph_runner); host_impl.SetVisible(true); host_impl.InitializeRenderer(compositor_frame_sink.get()); diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc index 3159ec5c5267b8..f0c113ddda5627 100644 --- a/cc/layers/picture_layer_impl_perftest.cc +++ b/cc/layers/picture_layer_impl_perftest.cc @@ -12,7 +12,6 @@ #include "cc/test/fake_layer_tree_host_impl.h" #include "cc/test/fake_picture_layer_impl.h" #include "cc/test/fake_raster_source.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/tiles/tiling_set_raster_queue_all.h" #include "cc/trees/layer_tree_impl.h" @@ -45,7 +44,6 @@ class PictureLayerImplPerfTest : public testing::Test { compositor_frame_sink_(FakeCompositorFrameSink::Create3d()), host_impl_(LayerTreeSettings(), &task_runner_provider_, - &shared_bitmap_manager_, &task_graph_runner_), timer_(kWarmupRuns, base::TimeDelta::FromMilliseconds(kTimeLimitMillis), @@ -172,7 +170,6 @@ class PictureLayerImplPerfTest : public testing::Test { } protected: - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; FakeImplTaskRunnerProvider task_runner_provider_; std::unique_ptr compositor_frame_sink_; diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index 0b43bf304be260..e96784fec916f8 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc @@ -34,7 +34,6 @@ #include "cc/test/gpu_rasterization_enabled_settings.h" #include "cc/test/layer_test_common.h" #include "cc/test/test_layer_tree_host_base.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/test/test_web_graphics_context_3d.h" #include "cc/tiles/tiling_set_raster_queue_all.h" diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc index c3645ed549b9d9..09b8213d010d60 100644 --- a/cc/layers/picture_layer_unittest.cc +++ b/cc/layers/picture_layer_unittest.cc @@ -27,7 +27,6 @@ #include "cc/test/layer_tree_settings_for_testing.h" #include "cc/test/skia_common.h" #include "cc/test/stub_layer_tree_host_single_thread_client.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/single_thread_proxy.h" #include "testing/gmock/include/gmock/gmock.h" @@ -252,12 +251,10 @@ TEST(PictureLayerTest, NoTilesIfEmptyBounds) { FakeImplTaskRunnerProvider impl_task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::CreateSoftware(); - FakeLayerTreeHostImpl host_impl(LayerTreeSettings(), - &impl_task_runner_provider, - &shared_bitmap_manager, &task_graph_runner); + FakeLayerTreeHostImpl host_impl( + LayerTreeSettings(), &impl_task_runner_provider, &task_graph_runner); host_impl.InitializeRenderer(compositor_frame_sink.get()); host_impl.CreatePendingTree(); std::unique_ptr layer_impl = @@ -293,14 +290,12 @@ TEST(PictureLayerTest, InvalidateRasterAfterUpdate) { host->CommitComplete(); FakeImplTaskRunnerProvider impl_task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; std::unique_ptr compositor_frame_sink( FakeCompositorFrameSink::Create3d()); LayerTreeSettings layer_tree_settings = LayerTreeSettingsForTesting(); layer_tree_settings.image_decode_tasks_enabled = true; - FakeLayerTreeHostImpl host_impl(layer_tree_settings, - &impl_task_runner_provider, - &shared_bitmap_manager, &task_graph_runner); + FakeLayerTreeHostImpl host_impl( + layer_tree_settings, &impl_task_runner_provider, &task_graph_runner); host_impl.SetVisible(true); host_impl.InitializeRenderer(compositor_frame_sink.get()); host_impl.CreatePendingTree(); @@ -337,14 +332,12 @@ TEST(PictureLayerTest, InvalidateRasterWithoutUpdate) { host->CommitComplete(); FakeImplTaskRunnerProvider impl_task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; std::unique_ptr compositor_frame_sink( FakeCompositorFrameSink::Create3d()); LayerTreeSettings layer_tree_settings = LayerTreeSettingsForTesting(); layer_tree_settings.image_decode_tasks_enabled = true; - FakeLayerTreeHostImpl host_impl(layer_tree_settings, - &impl_task_runner_provider, - &shared_bitmap_manager, &task_graph_runner); + FakeLayerTreeHostImpl host_impl( + layer_tree_settings, &impl_task_runner_provider, &task_graph_runner); host_impl.SetVisible(true); host_impl.InitializeRenderer(compositor_frame_sink.get()); host_impl.CreatePendingTree(); @@ -385,14 +378,12 @@ TEST(PictureLayerTest, ClearVisibleRectWhenNoTiling) { FakeImplTaskRunnerProvider impl_task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; std::unique_ptr compositor_frame_sink( FakeCompositorFrameSink::Create3d()); LayerTreeSettings layer_tree_settings = LayerTreeSettingsForTesting(); layer_tree_settings.image_decode_tasks_enabled = true; - FakeLayerTreeHostImpl host_impl(layer_tree_settings, - &impl_task_runner_provider, - &shared_bitmap_manager, &task_graph_runner); + FakeLayerTreeHostImpl host_impl( + layer_tree_settings, &impl_task_runner_provider, &task_graph_runner); host_impl.SetVisible(true); EXPECT_TRUE(host_impl.InitializeRenderer(compositor_frame_sink.get())); @@ -491,7 +482,6 @@ TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) { StubLayerTreeHostSingleThreadClient single_thread_client; FakeLayerTreeHostClient host_client1; FakeLayerTreeHostClient host_client2; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; ContentLayerClient* client = EmptyContentLayerClient::GetInstance(); @@ -499,7 +489,6 @@ TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) { LayerTreeHostInProcess::InitParams params; params.client = &host_client1; - params.shared_bitmap_manager = &shared_bitmap_manager; params.settings = &settings; params.task_graph_runner = &task_graph_runner; params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); @@ -513,7 +502,6 @@ TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) { // TODO(sad): InitParams will be movable. LayerTreeHostInProcess::InitParams params2; params2.client = &host_client1; - params2.shared_bitmap_manager = &shared_bitmap_manager; params2.settings = &settings; params2.task_graph_runner = &task_graph_runner; params2.main_task_runner = base::ThreadTaskRunnerHandle::Get(); diff --git a/cc/layers/render_surface_unittest.cc b/cc/layers/render_surface_unittest.cc index 898e2353ecbf35..dda0fb206f8312 100644 --- a/cc/layers/render_surface_unittest.cc +++ b/cc/layers/render_surface_unittest.cc @@ -12,7 +12,6 @@ #include "cc/test/fake_layer_tree_host_impl.h" #include "cc/test/geometry_test_utils.h" #include "cc/test/mock_occlusion_tracker.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/layer_tree_impl.h" #include "cc/trees/single_thread_proxy.h" @@ -39,10 +38,8 @@ TEST(RenderSurfaceTest, VerifySurfaceChangesAreTrackedProperly) { // FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr owning_layer = LayerImpl::Create(host_impl.active_tree(), 1); owning_layer->SetHasRenderSurface(true); @@ -90,12 +87,10 @@ TEST(RenderSurfaceTest, VerifySurfaceChangesAreTrackedProperly) { TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectSharedQuadState) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr root_layer = LayerImpl::Create(host_impl.active_tree(), 1); @@ -163,10 +158,8 @@ class TestRenderPassSink : public RenderPassSink { TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectRenderPass) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr root_layer = LayerImpl::Create(host_impl.active_tree(), 1); diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc index 5d784612d5c32b..86356770a25084 100644 --- a/cc/layers/scrollbar_layer_unittest.cc +++ b/cc/layers/scrollbar_layer_unittest.cc @@ -645,8 +645,7 @@ class ScrollbarLayerSolidColorThumbTest : public testing::Test { LayerTreeSettings layer_tree_settings; layer_tree_settings.verify_clip_tree_calculations = true; host_impl_.reset(new FakeLayerTreeHostImpl( - layer_tree_settings, &task_runner_provider_, &shared_bitmap_manager_, - &task_graph_runner_)); + layer_tree_settings, &task_runner_provider_, &task_graph_runner_)); const int kThumbThickness = 3; const int kTrackStart = 0; @@ -673,7 +672,6 @@ class ScrollbarLayerSolidColorThumbTest : public testing::Test { protected: FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; std::unique_ptr host_impl_; std::unique_ptr horizontal_scrollbar_layer_; diff --git a/cc/layers/solid_color_layer_impl_unittest.cc b/cc/layers/solid_color_layer_impl_unittest.cc index f02e0d294f66b6..dd30563580b280 100644 --- a/cc/layers/solid_color_layer_impl_unittest.cc +++ b/cc/layers/solid_color_layer_impl_unittest.cc @@ -31,8 +31,7 @@ TEST(SolidColorLayerImplTest, VerifyTilingCompleteAndNoOverlap) { FakeImplTaskRunnerProvider task_runner_provider; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, nullptr, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr layer = SolidColorLayerImpl::Create(host_impl.active_tree(), 1); layer->draw_properties().visible_layer_rect = visible_layer_rect; @@ -56,8 +55,7 @@ TEST(SolidColorLayerImplTest, VerifyCorrectBackgroundColorInQuad) { FakeImplTaskRunnerProvider task_runner_provider; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, nullptr, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr layer = SolidColorLayerImpl::Create(host_impl.active_tree(), 1); layer->draw_properties().visible_layer_rect = visible_layer_rect; @@ -84,8 +82,7 @@ TEST(SolidColorLayerImplTest, VerifyCorrectOpacityInQuad) { FakeImplTaskRunnerProvider task_runner_provider; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, nullptr, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr layer = SolidColorLayerImpl::Create(host_impl.active_tree(), 1); layer->draw_properties().visible_layer_rect = visible_layer_rect; @@ -111,8 +108,7 @@ TEST(SolidColorLayerImplTest, VerifyCorrectBlendModeInQuad) { FakeImplTaskRunnerProvider task_runner_provider; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, nullptr, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr layer = SolidColorLayerImpl::Create(host_impl.active_tree(), 1); layer->SetBounds(layer_size); diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc index 7c00e4849b9828..91b0dcdfc57fec 100644 --- a/cc/layers/texture_layer_unittest.cc +++ b/cc/layers/texture_layer_unittest.cc @@ -210,7 +210,6 @@ class TextureLayerTest : public testing::Test { TextureLayerTest() : compositor_frame_sink_(FakeCompositorFrameSink::Create3d()), host_impl_(&task_runner_provider_, - &shared_bitmap_manager_, &task_graph_runner_), test_data_(&shared_bitmap_manager_) {} diff --git a/cc/layers/ui_resource_layer_impl_unittest.cc b/cc/layers/ui_resource_layer_impl_unittest.cc index 727a6e1a6afb24..5acc56a117c6b5 100644 --- a/cc/layers/ui_resource_layer_impl_unittest.cc +++ b/cc/layers/ui_resource_layer_impl_unittest.cc @@ -14,7 +14,6 @@ #include "cc/test/fake_layer_tree_host_impl.h" #include "cc/test/fake_ui_resource_layer_tree_host_impl.h" #include "cc/test/layer_test_common.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/single_thread_proxy.h" #include "testing/gmock/include/gmock/gmock.h" @@ -59,12 +58,11 @@ void QuadSizeTest(std::unique_ptr layer, TEST(UIResourceLayerImplTest, VerifyDrawQuads) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeUIResourceLayerTreeHostImpl host_impl( - &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); + FakeUIResourceLayerTreeHostImpl host_impl(&task_runner_provider, + &task_graph_runner); host_impl.SetVisible(true); host_impl.InitializeRenderer(compositor_frame_sink.get()); @@ -105,12 +103,11 @@ void OpaqueBoundsTest(std::unique_ptr layer, TEST(UIResourceLayerImplTest, VerifySetOpaqueOnSkBitmap) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeUIResourceLayerTreeHostImpl host_impl( - &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); + FakeUIResourceLayerTreeHostImpl host_impl(&task_runner_provider, + &task_graph_runner); host_impl.SetVisible(true); host_impl.InitializeRenderer(compositor_frame_sink.get()); @@ -135,12 +132,11 @@ TEST(UIResourceLayerImplTest, VerifySetOpaqueOnSkBitmap) { TEST(UIResourceLayerImplTest, VerifySetOpaqueOnLayer) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeUIResourceLayerTreeHostImpl host_impl( - &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); + FakeUIResourceLayerTreeHostImpl host_impl(&task_runner_provider, + &task_graph_runner); host_impl.SetVisible(true); host_impl.InitializeRenderer(compositor_frame_sink.get()); diff --git a/cc/output/compositor_frame_sink.cc b/cc/output/compositor_frame_sink.cc index 9e2642d24f81e9..a42c3683eed37d 100644 --- a/cc/output/compositor_frame_sink.cc +++ b/cc/output/compositor_frame_sink.cc @@ -20,15 +20,21 @@ namespace cc { CompositorFrameSink::CompositorFrameSink( scoped_refptr context_provider, - scoped_refptr worker_context_provider) + scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + SharedBitmapManager* shared_bitmap_manager) : context_provider_(std::move(context_provider)), - worker_context_provider_(std::move(worker_context_provider)) { + worker_context_provider_(std::move(worker_context_provider)), + gpu_memory_buffer_manager_(gpu_memory_buffer_manager), + shared_bitmap_manager_(shared_bitmap_manager) { client_thread_checker_.DetachFromThread(); } CompositorFrameSink::CompositorFrameSink( scoped_refptr vulkan_context_provider) - : vulkan_context_provider_(vulkan_context_provider) { + : vulkan_context_provider_(vulkan_context_provider), + gpu_memory_buffer_manager_(nullptr), + shared_bitmap_manager_(nullptr) { client_thread_checker_.DetachFromThread(); } diff --git a/cc/output/compositor_frame_sink.h b/cc/output/compositor_frame_sink.h index 5aa440552e3573..1cd1966188b7fc 100644 --- a/cc/output/compositor_frame_sink.h +++ b/cc/output/compositor_frame_sink.h @@ -30,11 +30,16 @@ class Size; class Transform; } +namespace gpu { +class GpuMemoryBufferManager; +} + namespace cc { class CompositorFrame; struct ManagedMemoryPolicy; class CompositorFrameSinkClient; +class SharedBitmapManager; // An interface for submitting CompositorFrames to a display compositor // which will compose frames from multiple CompositorFrameSinks to show @@ -56,8 +61,16 @@ class CC_EXPORT CompositorFrameSink { }; // Constructor for GL-based and/or software resources. + // gpu_memory_buffer_manager and shared_bitmap_manager must outlive the + // CompositorFrameSink. + // shared_bitmap_manager is optional (won't be used) if context_provider is + // present. + // gpu_memory_buffer_manager is optional (won't be used) if context_provider + // is not present. CompositorFrameSink(scoped_refptr context_provider, - scoped_refptr worker_context_provider); + scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + SharedBitmapManager* shared_bitmap_manager); // Constructor for Vulkan-based resources. explicit CompositorFrameSink( @@ -93,6 +106,12 @@ class CC_EXPORT CompositorFrameSink { VulkanContextProvider* vulkan_context_provider() const { return vulkan_context_provider_.get(); } + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const { + return gpu_memory_buffer_manager_; + } + SharedBitmapManager* shared_bitmap_manager() const { + return shared_bitmap_manager_; + } // If supported, this causes a ReclaimResources for all resources that are // currently in use. @@ -120,6 +139,8 @@ class CC_EXPORT CompositorFrameSink { scoped_refptr context_provider_; scoped_refptr worker_context_provider_; scoped_refptr vulkan_context_provider_; + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; + SharedBitmapManager* shared_bitmap_manager_; base::ThreadChecker client_thread_checker_; private: diff --git a/cc/output/compositor_frame_sink_unittest.cc b/cc/output/compositor_frame_sink_unittest.cc index 4087c5c68a3237..6a72c8d58bbe2f 100644 --- a/cc/output/compositor_frame_sink_unittest.cc +++ b/cc/output/compositor_frame_sink_unittest.cc @@ -21,7 +21,9 @@ class TestCompositorFrameSink : public CompositorFrameSink { scoped_refptr context_provider, scoped_refptr worker_context_provider) : CompositorFrameSink(std::move(context_provider), - std::move(worker_context_provider)) {} + std::move(worker_context_provider), + nullptr, + nullptr) {} void SubmitCompositorFrame(CompositorFrame frame) override { client_->DidReceiveCompositorFrameAck(); diff --git a/cc/surfaces/direct_compositor_frame_sink.cc b/cc/surfaces/direct_compositor_frame_sink.cc index 194a08e7be50f4..05e2b000a2f66b 100644 --- a/cc/surfaces/direct_compositor_frame_sink.cc +++ b/cc/surfaces/direct_compositor_frame_sink.cc @@ -20,9 +20,13 @@ DirectCompositorFrameSink::DirectCompositorFrameSink( SurfaceManager* surface_manager, Display* display, scoped_refptr context_provider, - scoped_refptr worker_context_provider) + scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + SharedBitmapManager* shared_bitmap_manager) : CompositorFrameSink(std::move(context_provider), - std::move(worker_context_provider)), + std::move(worker_context_provider), + gpu_memory_buffer_manager, + shared_bitmap_manager), frame_sink_id_(frame_sink_id), surface_manager_(surface_manager), display_(display), diff --git a/cc/surfaces/direct_compositor_frame_sink.h b/cc/surfaces/direct_compositor_frame_sink.h index cef7518309418b..86210dabab4cb1 100644 --- a/cc/surfaces/direct_compositor_frame_sink.h +++ b/cc/surfaces/direct_compositor_frame_sink.h @@ -33,7 +33,9 @@ class CC_SURFACES_EXPORT DirectCompositorFrameSink SurfaceManager* surface_manager, Display* display, scoped_refptr context_provider, - scoped_refptr worker_context_provider); + scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + SharedBitmapManager* shared_bitmap_manager); DirectCompositorFrameSink( const FrameSinkId& frame_sink_id, SurfaceManager* surface_manager, diff --git a/cc/surfaces/direct_compositor_frame_sink_unittest.cc b/cc/surfaces/direct_compositor_frame_sink_unittest.cc index 8589a5266231ba..75a06d98df5c19 100644 --- a/cc/surfaces/direct_compositor_frame_sink_unittest.cc +++ b/cc/surfaces/direct_compositor_frame_sink_unittest.cc @@ -57,7 +57,8 @@ class DirectCompositorFrameSinkTest : public testing::Test { base::MakeUnique(task_runner_.get()))); compositor_frame_sink_.reset(new DirectCompositorFrameSink( kArbitraryFrameSinkId, &surface_manager_, display_.get(), - context_provider_, nullptr)); + context_provider_, nullptr, &gpu_memory_buffer_manager_, + &bitmap_manager_)); compositor_frame_sink_->BindToClient(&compositor_frame_sink_client_); display_->Resize(display_size_); diff --git a/cc/test/fake_compositor_frame_sink.cc b/cc/test/fake_compositor_frame_sink.cc index aa01fb871f7258..64ab5e35f37426 100644 --- a/cc/test/fake_compositor_frame_sink.cc +++ b/cc/test/fake_compositor_frame_sink.cc @@ -17,8 +17,15 @@ FakeCompositorFrameSink::FakeCompositorFrameSink( scoped_refptr context_provider, scoped_refptr worker_context_provider) : CompositorFrameSink(std::move(context_provider), - std::move(worker_context_provider)), - weak_ptr_factory_(this) {} + std::move(worker_context_provider), + nullptr, + nullptr), + weak_ptr_factory_(this) { + gpu_memory_buffer_manager_ = + context_provider_ ? &test_gpu_memory_buffer_manager_ : nullptr; + shared_bitmap_manager_ = + context_provider_ ? nullptr : &test_shared_bitmap_manager_; +} FakeCompositorFrameSink::~FakeCompositorFrameSink() = default; diff --git a/cc/test/fake_compositor_frame_sink.h b/cc/test/fake_compositor_frame_sink.h index eb6749e89cecce..27a964eaf201ba 100644 --- a/cc/test/fake_compositor_frame_sink.h +++ b/cc/test/fake_compositor_frame_sink.h @@ -18,6 +18,8 @@ #include "cc/output/software_output_device.h" #include "cc/test/test_context_provider.h" #include "cc/test/test_gles2_interface.h" +#include "cc/test/test_gpu_memory_buffer_manager.h" +#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_web_graphics_context_3d.h" namespace cc { @@ -73,6 +75,9 @@ class FakeCompositorFrameSink : public CompositorFrameSink { scoped_refptr context_provider, scoped_refptr worker_context_provider); + TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_; + TestSharedBitmapManager test_shared_bitmap_manager_; + std::unique_ptr last_sent_frame_; size_t num_sent_frames_ = 0; TransferableResourceArray resources_held_by_parent_; diff --git a/cc/test/fake_layer_tree_host.cc b/cc/test/fake_layer_tree_host.cc index bc11a76bd069be..1e68ae3b215191 100644 --- a/cc/test/fake_layer_tree_host.cc +++ b/cc/test/fake_layer_tree_host.cc @@ -37,7 +37,6 @@ FakeLayerTreeHost::FakeLayerTreeHost(FakeLayerTreeHostClient* client, client_(client), host_impl_(*params->settings, &task_runner_provider_, - &manager_, params->task_graph_runner), needs_commit_(false) { scoped_refptr impl_task_runner = diff --git a/cc/test/fake_layer_tree_host.h b/cc/test/fake_layer_tree_host.h index 57090ac7a9f2cf..3f37b2cd32ea9f 100644 --- a/cc/test/fake_layer_tree_host.h +++ b/cc/test/fake_layer_tree_host.h @@ -9,7 +9,6 @@ #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host_client.h" #include "cc/test/fake_layer_tree_host_impl.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/trees/layer_tree_host_in_process.h" #include "cc/trees/layer_tree_impl.h" #include "cc/trees/tree_synchronizer.h" @@ -90,7 +89,6 @@ class FakeLayerTreeHost : public LayerTreeHostInProcess { private: FakeImplTaskRunnerProvider task_runner_provider_; FakeLayerTreeHostClient* client_; - TestSharedBitmapManager manager_; FakeLayerTreeHostImpl host_impl_; bool needs_commit_; }; diff --git a/cc/test/fake_layer_tree_host_impl.cc b/cc/test/fake_layer_tree_host_impl.cc index 7db83d492a562d..06ee5c88f9f0fe 100644 --- a/cc/test/fake_layer_tree_host_impl.cc +++ b/cc/test/fake_layer_tree_host_impl.cc @@ -10,44 +10,25 @@ #include "cc/test/begin_frame_args_test.h" #include "cc/test/fake_layer_tree_host_impl.h" #include "cc/test/layer_tree_settings_for_testing.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/trees/layer_tree_impl.h" namespace cc { FakeLayerTreeHostImpl::FakeLayerTreeHostImpl( TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* manager, TaskGraphRunner* task_graph_runner) : FakeLayerTreeHostImpl(LayerTreeSettingsForTesting(), task_runner_provider, - manager, - task_graph_runner, - nullptr) {} + task_graph_runner) {} FakeLayerTreeHostImpl::FakeLayerTreeHostImpl( const LayerTreeSettings& settings, TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* manager, TaskGraphRunner* task_graph_runner) - : FakeLayerTreeHostImpl(settings, - task_runner_provider, - manager, - task_graph_runner, - nullptr) {} - -FakeLayerTreeHostImpl::FakeLayerTreeHostImpl( - const LayerTreeSettings& settings, - TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* manager, - TaskGraphRunner* task_graph_runner, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) : LayerTreeHostImpl(settings, &client_, task_runner_provider, &stats_instrumentation_, - manager, - gpu_memory_buffer_manager, task_graph_runner, AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0), diff --git a/cc/test/fake_layer_tree_host_impl.h b/cc/test/fake_layer_tree_host_impl.h index 4c36fbf5898e7c..2dd16063499ece 100644 --- a/cc/test/fake_layer_tree_host_impl.h +++ b/cc/test/fake_layer_tree_host_impl.h @@ -19,17 +19,10 @@ namespace cc { class FakeLayerTreeHostImpl : public LayerTreeHostImpl { public: FakeLayerTreeHostImpl(TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* manager, TaskGraphRunner* task_graph_runner); FakeLayerTreeHostImpl(const LayerTreeSettings& settings, TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* manager, TaskGraphRunner* task_graph_runner); - FakeLayerTreeHostImpl(const LayerTreeSettings& settings, - TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* manager, - TaskGraphRunner* task_graph_runner, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); ~FakeLayerTreeHostImpl() override; void ForcePrepareToDraw() { diff --git a/cc/test/fake_ui_resource_layer_tree_host_impl.cc b/cc/test/fake_ui_resource_layer_tree_host_impl.cc index dd54a2cf559675..6530706ade3a6c 100644 --- a/cc/test/fake_ui_resource_layer_tree_host_impl.cc +++ b/cc/test/fake_ui_resource_layer_tree_host_impl.cc @@ -11,9 +11,8 @@ namespace cc { FakeUIResourceLayerTreeHostImpl::FakeUIResourceLayerTreeHostImpl( TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* manager, TaskGraphRunner* task_graph_runner) - : FakeLayerTreeHostImpl(task_runner_provider, manager, task_graph_runner) {} + : FakeLayerTreeHostImpl(task_runner_provider, task_graph_runner) {} FakeUIResourceLayerTreeHostImpl::~FakeUIResourceLayerTreeHostImpl() {} diff --git a/cc/test/fake_ui_resource_layer_tree_host_impl.h b/cc/test/fake_ui_resource_layer_tree_host_impl.h index be58cbd5704cc2..e2b1c397cba1b8 100644 --- a/cc/test/fake_ui_resource_layer_tree_host_impl.h +++ b/cc/test/fake_ui_resource_layer_tree_host_impl.h @@ -16,7 +16,6 @@ class FakeUIResourceLayerTreeHostImpl : public FakeLayerTreeHostImpl { public: explicit FakeUIResourceLayerTreeHostImpl( TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* manager, TaskGraphRunner* task_graph_runner); ~FakeUIResourceLayerTreeHostImpl() override; diff --git a/cc/test/layer_tree_host_remote_for_testing.cc b/cc/test/layer_tree_host_remote_for_testing.cc index 9c48b89ec6ab1f..30e9e65ecd0fbf 100644 --- a/cc/test/layer_tree_host_remote_for_testing.cc +++ b/cc/test/layer_tree_host_remote_for_testing.cc @@ -113,8 +113,6 @@ LayerTreeHostRemoteForTesting::Create( LayerTreeHostClient* client, std::unique_ptr animation_host, LayerTreeSettings const* settings, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, scoped_refptr main_task_runner, scoped_refptr impl_task_runner) { @@ -134,8 +132,7 @@ LayerTreeHostRemoteForTesting::Create( std::unique_ptr layer_tree_host = base::WrapUnique(new LayerTreeHostRemoteForTesting(¶ms)); - layer_tree_host->Initialize(shared_bitmap_manager, gpu_memory_buffer_manager, - task_graph_runner, main_task_runner, + layer_tree_host->Initialize(task_graph_runner, main_task_runner, impl_task_runner, std::move(image_serialization_processor)); return layer_tree_host; @@ -194,8 +191,6 @@ LayerTreeHostRemoteForTesting::GetInputHandler() const { } void LayerTreeHostRemoteForTesting::Initialize( - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, scoped_refptr main_task_runner, scoped_refptr impl_task_runner, @@ -207,9 +202,8 @@ void LayerTreeHostRemoteForTesting::Initialize( remote_compositor_bridge_impl->SetRemoteHost(this); layer_tree_host_in_process_ = CreateLayerTreeHostInProcess( - layer_tree_host_in_process_client_.get(), shared_bitmap_manager, - gpu_memory_buffer_manager, task_graph_runner, GetSettings(), - main_task_runner, impl_task_runner); + layer_tree_host_in_process_client_.get(), task_graph_runner, + GetSettings(), main_task_runner, impl_task_runner); compositor_state_deserializer_ = base::MakeUnique( @@ -233,8 +227,6 @@ void LayerTreeHostRemoteForTesting::Initialize( std::unique_ptr LayerTreeHostRemoteForTesting::CreateLayerTreeHostInProcess( LayerTreeHostClient* client, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, const LayerTreeSettings& settings, scoped_refptr main_task_runner, @@ -242,8 +234,6 @@ LayerTreeHostRemoteForTesting::CreateLayerTreeHostInProcess( LayerTreeHostInProcess::InitParams params; params.client = client; - params.shared_bitmap_manager = shared_bitmap_manager; - params.gpu_memory_buffer_manager = gpu_memory_buffer_manager; params.task_graph_runner = task_graph_runner; params.settings = &settings; params.main_task_runner = main_task_runner; diff --git a/cc/test/layer_tree_host_remote_for_testing.h b/cc/test/layer_tree_host_remote_for_testing.h index 2af67222c216ce..d2efbf91fe0697 100644 --- a/cc/test/layer_tree_host_remote_for_testing.h +++ b/cc/test/layer_tree_host_remote_for_testing.h @@ -31,8 +31,6 @@ class LayerTreeHostRemoteForTesting : public LayerTreeHostRemote, LayerTreeHostClient* client, std::unique_ptr animation_host, LayerTreeSettings const* settings, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, scoped_refptr main_task_runner, scoped_refptr impl_task_runner); @@ -59,9 +57,7 @@ class LayerTreeHostRemoteForTesting : public LayerTreeHostRemote, protected: explicit LayerTreeHostRemoteForTesting(InitParams* params); - void Initialize(SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, - TaskGraphRunner* task_graph_runner, + void Initialize(TaskGraphRunner* task_graph_runner, scoped_refptr main_task_runner, scoped_refptr impl_task_runner, std::unique_ptr @@ -69,8 +65,6 @@ class LayerTreeHostRemoteForTesting : public LayerTreeHostRemote, virtual std::unique_ptr CreateLayerTreeHostInProcess( LayerTreeHostClient* client, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, const LayerTreeSettings& settings, scoped_refptr main_task_runner, diff --git a/cc/test/layer_tree_json_parser_unittest.cc b/cc/test/layer_tree_json_parser_unittest.cc index 250992ee54c60d..e600eef95bbe00 100644 --- a/cc/test/layer_tree_json_parser_unittest.cc +++ b/cc/test/layer_tree_json_parser_unittest.cc @@ -63,10 +63,8 @@ class LayerTreeJsonParserSanityCheck : public testing::Test { TEST_F(LayerTreeJsonParserSanityCheck, Basic) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); LayerTreeImpl* tree = host_impl.active_tree(); std::unique_ptr root_impl(LayerImpl::Create(tree, 1)); @@ -96,10 +94,8 @@ TEST_F(LayerTreeJsonParserSanityCheck, Basic) { TEST_F(LayerTreeJsonParserSanityCheck, EventHandlerRegions) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); LayerTreeImpl* tree = host_impl.active_tree(); std::unique_ptr root_impl(LayerImpl::Create(tree, 1)); diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 989e77645cca13..1e5f08cec0be20 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc @@ -98,14 +98,11 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl { const LayerTreeSettings& settings, LayerTreeHostImplClient* host_impl_client, TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, RenderingStatsInstrumentation* stats_instrumentation) { return base::WrapUnique(new LayerTreeHostImplForTesting( test_hooks, settings, host_impl_client, task_runner_provider, - shared_bitmap_manager, gpu_memory_buffer_manager, task_graph_runner, - stats_instrumentation)); + task_graph_runner, stats_instrumentation)); } protected: @@ -114,16 +111,12 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl { const LayerTreeSettings& settings, LayerTreeHostImplClient* host_impl_client, TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, RenderingStatsInstrumentation* stats_instrumentation) : LayerTreeHostImpl(settings, host_impl_client, task_runner_provider, stats_instrumentation, - shared_bitmap_manager, - gpu_memory_buffer_manager, task_graph_runner, AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0), @@ -347,16 +340,12 @@ class LayerTreeHostForTesting : public LayerTreeHostInProcess { CompositorMode mode, LayerTreeHostClient* client, LayerTreeHostSingleThreadClient* single_thread_client, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, const LayerTreeSettings& settings, scoped_refptr main_task_runner, scoped_refptr impl_task_runner) { LayerTreeHostInProcess::InitParams params; params.client = client; - params.shared_bitmap_manager = shared_bitmap_manager; - params.gpu_memory_buffer_manager = gpu_memory_buffer_manager; params.task_graph_runner = task_graph_runner; params.settings = &settings; @@ -391,8 +380,7 @@ class LayerTreeHostForTesting : public LayerTreeHostInProcess { std::unique_ptr host_impl = LayerTreeHostImplForTesting::Create( test_hooks_, GetSettings(), host_impl_client, - GetTaskRunnerProvider(), shared_bitmap_manager(), - gpu_memory_buffer_manager(), task_graph_runner(), + GetTaskRunnerProvider(), task_graph_runner(), rendering_stats_instrumentation()); input_handler_weak_ptr_ = host_impl->AsWeakPtr(); return host_impl; @@ -433,8 +421,6 @@ class LayerTreeHostRemoteForLayerTreeTest TestHooks* test_hooks, LayerTreeHostClient* client, LayerTreeSettings const* settings, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, scoped_refptr main_task_runner, scoped_refptr impl_task_runner) { @@ -456,9 +442,8 @@ class LayerTreeHostRemoteForLayerTreeTest std::unique_ptr layer_tree_host = base::WrapUnique( new LayerTreeHostRemoteForLayerTreeTest(¶ms, test_hooks)); - layer_tree_host->Initialize(shared_bitmap_manager, - gpu_memory_buffer_manager, task_graph_runner, - main_task_runner, impl_task_runner, + layer_tree_host->Initialize(task_graph_runner, main_task_runner, + impl_task_runner, std::move(image_serialization_processor)); return layer_tree_host; } @@ -467,16 +452,13 @@ class LayerTreeHostRemoteForLayerTreeTest std::unique_ptr CreateLayerTreeHostInProcess( LayerTreeHostClient* client, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, const LayerTreeSettings& settings, scoped_refptr main_task_runner, scoped_refptr impl_task_runner) override { return LayerTreeHostForTesting::Create( test_hooks_, CompositorMode::THREADED, client, nullptr, - shared_bitmap_manager, gpu_memory_buffer_manager, task_graph_runner, - settings, main_task_runner, impl_task_runner); + task_graph_runner, settings, main_task_runner, impl_task_runner); } private: @@ -672,8 +654,7 @@ void LayerTreeTest::DoBeginTest() { if (IsRemoteTest()) { std::unique_ptr layer_tree_host_remote = LayerTreeHostRemoteForLayerTreeTest::Create( - this, client_.get(), &settings_, shared_bitmap_manager_.get(), - gpu_memory_buffer_manager_.get(), task_graph_runner_.get(), + this, client_.get(), &settings_, task_graph_runner_.get(), main_task_runner, impl_task_runner); layer_tree_host_in_process_ = layer_tree_host_remote->layer_tree_host_in_process(); @@ -681,10 +662,8 @@ void LayerTreeTest::DoBeginTest() { } else { std::unique_ptr layer_tree_host_for_testing = LayerTreeHostForTesting::Create( - this, mode_, client_.get(), client_.get(), - shared_bitmap_manager_.get(), gpu_memory_buffer_manager_.get(), - task_graph_runner_.get(), settings_, main_task_runner, - impl_task_runner); + this, mode_, client_.get(), client_.get(), task_graph_runner_.get(), + settings_, main_task_runner, impl_task_runner); layer_tree_host_in_process_ = layer_tree_host_for_testing.get(); layer_tree_host_ = std::move(layer_tree_host_for_testing); } diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h index 6c58ab765786f2..bb0813622a3a09 100644 --- a/cc/test/layer_tree_test.h +++ b/cc/test/layer_tree_test.h @@ -31,7 +31,6 @@ class ProxyImpl; class ProxyMain; class TestContextProvider; class TestCompositorFrameSink; -class TestGpuMemoryBufferManager; class TestTaskGraphRunner; class TestWebGraphicsContext3D; diff --git a/cc/test/test_compositor_frame_sink.cc b/cc/test/test_compositor_frame_sink.cc index 1d33bf97d21be4..af5cbb445e9833 100644 --- a/cc/test/test_compositor_frame_sink.cc +++ b/cc/test/test_compositor_frame_sink.cc @@ -28,11 +28,11 @@ TestCompositorFrameSink::TestCompositorFrameSink( bool synchronous_composite, bool force_disable_reclaim_resources) : CompositorFrameSink(std::move(compositor_context_provider), - std::move(worker_context_provider)), + std::move(worker_context_provider), + gpu_memory_buffer_manager, + shared_bitmap_manager), synchronous_composite_(synchronous_composite), renderer_settings_(renderer_settings), - shared_bitmap_manager_(shared_bitmap_manager), - gpu_memory_buffer_manager_(gpu_memory_buffer_manager), task_runner_(std::move(task_runner)), frame_sink_id_(kCompositorFrameSinkId), surface_manager_(new SurfaceManager), @@ -87,7 +87,7 @@ bool TestCompositorFrameSink::BindToClient(CompositorFrameSinkClient* client) { } display_.reset( - new Display(shared_bitmap_manager_, gpu_memory_buffer_manager_, + new Display(shared_bitmap_manager(), gpu_memory_buffer_manager(), renderer_settings_, std::move(begin_frame_source), std::move(display_output_surface), std::move(scheduler), base::MakeUnique(task_runner_.get()))); diff --git a/cc/test/test_compositor_frame_sink.h b/cc/test/test_compositor_frame_sink.h index 32d54f7aec767e..d35efed7355906 100644 --- a/cc/test/test_compositor_frame_sink.h +++ b/cc/test/test_compositor_frame_sink.h @@ -92,8 +92,6 @@ class TestCompositorFrameSink : public CompositorFrameSink, const bool synchronous_composite_; const RendererSettings renderer_settings_; - SharedBitmapManager* const shared_bitmap_manager_; - gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; scoped_refptr task_runner_; diff --git a/cc/test/test_layer_tree_host_base.cc b/cc/test/test_layer_tree_host_base.cc index 58031957947847..80aacc4c288a78 100644 --- a/cc/test/test_layer_tree_host_base.cc +++ b/cc/test/test_layer_tree_host_base.cc @@ -24,8 +24,7 @@ void TestLayerTreeHostBase::SetUp() { compositor_frame_sink_ = CreateCompositorFrameSink(); task_graph_runner_ = CreateTaskGraphRunner(); host_impl_ = CreateHostImpl(CreateSettings(), &task_runner_provider_, - &shared_bitmap_manager_, task_graph_runner_.get(), - &gpu_memory_buffer_manager_); + task_graph_runner_.get()); InitializeRenderer(); SetInitialTreePriority(); } @@ -44,12 +43,9 @@ TestLayerTreeHostBase::CreateCompositorFrameSink() { std::unique_ptr TestLayerTreeHostBase::CreateHostImpl( const LayerTreeSettings& settings, TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* shared_bitmap_manager, - TaskGraphRunner* task_graph_runner, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { - return base::MakeUnique( - settings, task_runner_provider, shared_bitmap_manager, task_graph_runner, - gpu_memory_buffer_manager); + TaskGraphRunner* task_graph_runner) { + return base::MakeUnique(settings, task_runner_provider, + task_graph_runner); } std::unique_ptr diff --git a/cc/test/test_layer_tree_host_base.h b/cc/test/test_layer_tree_host_base.h index b9c48eb9ce62ff..abce2ed061f35b 100644 --- a/cc/test/test_layer_tree_host_base.h +++ b/cc/test/test_layer_tree_host_base.h @@ -11,8 +11,6 @@ #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host_impl.h" #include "cc/test/fake_picture_layer_impl.h" -#include "cc/test/test_gpu_memory_buffer_manager.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/tiles/tile_priority.h" #include "testing/gtest/include/gtest/gtest.h" @@ -32,9 +30,7 @@ class TestLayerTreeHostBase : public testing::Test { virtual std::unique_ptr CreateHostImpl( const LayerTreeSettings& settings, TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* shared_bitmap_manager, - TaskGraphRunner* task_graph_runner, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_); + TaskGraphRunner* task_graph_runner); virtual std::unique_ptr CreateTaskGraphRunner(); virtual void InitializeRenderer(); @@ -68,9 +64,7 @@ class TestLayerTreeHostBase : public testing::Test { void SetInitialTreePriority(); FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; std::unique_ptr task_graph_runner_; - TestGpuMemoryBufferManager gpu_memory_buffer_manager_; std::unique_ptr compositor_frame_sink_; std::unique_ptr host_impl_; diff --git a/cc/tiles/picture_layer_tiling_unittest.cc b/cc/tiles/picture_layer_tiling_unittest.cc index db739287acff69..ded8ad42346c66 100644 --- a/cc/tiles/picture_layer_tiling_unittest.cc +++ b/cc/tiles/picture_layer_tiling_unittest.cc @@ -18,7 +18,6 @@ #include "cc/test/fake_picture_layer_tiling_client.h" #include "cc/test/fake_raster_source.h" #include "cc/test/test_context_provider.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/tiles/picture_layer_tiling_set.h" #include "cc/trees/layer_tree_settings.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/cc/tiles/tile_manager_perftest.cc b/cc/tiles/tile_manager_perftest.cc index 94ceaff813bef8..d2724a7e8341a0 100644 --- a/cc/tiles/tile_manager_perftest.cc +++ b/cc/tiles/tile_manager_perftest.cc @@ -22,7 +22,6 @@ #include "cc/test/fake_tile_manager_client.h" #include "cc/test/fake_tile_task_manager.h" #include "cc/test/test_layer_tree_host_base.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/test/test_tile_priorities.h" #include "cc/tiles/tile.h" diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc index 42929852002223..bf47cd3d5b6e04 100644 --- a/cc/tiles/tile_manager_unittest.cc +++ b/cc/tiles/tile_manager_unittest.cc @@ -25,9 +25,7 @@ #include "cc/test/fake_tile_manager.h" #include "cc/test/fake_tile_task_manager.h" #include "cc/test/layer_tree_settings_for_testing.h" -#include "cc/test/test_gpu_memory_buffer_manager.h" #include "cc/test/test_layer_tree_host_base.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/test/test_tile_priorities.h" #include "cc/tiles/eviction_tile_priority_queue.h" @@ -1475,17 +1473,12 @@ class TileManagerTest : public TestLayerTreeHostBase { // MockLayerTreeHostImpl allows us to intercept tile manager callbacks. class MockLayerTreeHostImpl : public FakeLayerTreeHostImpl { public: - MockLayerTreeHostImpl( - const LayerTreeSettings& settings, - TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* manager, - TaskGraphRunner* task_graph_runner, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) + MockLayerTreeHostImpl(const LayerTreeSettings& settings, + TaskRunnerProvider* task_runner_provider, + TaskGraphRunner* task_graph_runner) : FakeLayerTreeHostImpl(settings, task_runner_provider, - manager, - task_graph_runner, - gpu_memory_buffer_manager) {} + task_graph_runner) {} MOCK_METHOD0(NotifyAllTileTasksCompleted, void()); MOCK_METHOD0(NotifyReadyToDraw, void()); @@ -1494,12 +1487,9 @@ class TileManagerTest : public TestLayerTreeHostBase { std::unique_ptr CreateHostImpl( const LayerTreeSettings& settings, TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* shared_bitmap_manager, - TaskGraphRunner* task_graph_runner, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) override { + TaskGraphRunner* task_graph_runner) override { return base::MakeUnique( - settings, task_runner_provider, shared_bitmap_manager, - task_graph_runner, gpu_memory_buffer_manager); + settings, task_runner_provider, task_graph_runner); } // By default use software compositing (no context provider). diff --git a/cc/trees/damage_tracker_unittest.cc b/cc/trees/damage_tracker_unittest.cc index 4975bfdccdd2d9..c0429871e7f018 100644 --- a/cc/trees/damage_tracker_unittest.cc +++ b/cc/trees/damage_tracker_unittest.cc @@ -13,7 +13,6 @@ #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_host_impl.h" #include "cc/test/geometry_test_utils.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_impl.h" @@ -86,9 +85,7 @@ void EmulateDrawingOneFrame( class DamageTrackerTest : public testing::Test { public: DamageTrackerTest() - : host_impl_(&task_runner_provider_, - &shared_bitmap_manager_, - &task_graph_runner_) {} + : host_impl_(&task_runner_provider_, &task_graph_runner_) {} LayerImpl* CreateTestTreeWithOneSurface() { host_impl_.active_tree()->DetachLayers(); @@ -186,7 +183,6 @@ class DamageTrackerTest : public testing::Test { protected: FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; FakeLayerTreeHostImpl host_impl_; }; diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index 4db9925ec17c4b..1f04cb550493f3 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc @@ -521,10 +521,8 @@ TEST_F(LayerTreeHostCommonTest, TransformsAboutScrollOffset) { const float kDeviceScale = 1.666f; FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr sublayer_scoped_ptr( LayerImpl::Create(host_impl.active_tree(), 1)); @@ -3447,12 +3445,10 @@ TEST_F(LayerTreeHostCommonTest, TEST_F(LayerTreeHostCommonTest, OcclusionBySiblingOfTarget) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr root = LayerImpl::Create(host_impl.active_tree(), 1); @@ -3524,12 +3520,10 @@ TEST_F(LayerTreeHostCommonTest, OcclusionBySiblingOfTarget) { TEST_F(LayerTreeHostCommonTest, TextureLayerSnapping) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr root = LayerImpl::Create(host_impl.active_tree(), 1); @@ -3568,12 +3562,10 @@ TEST_F(LayerTreeHostCommonTest, TextureLayerSnapping) { TEST_F(LayerTreeHostCommonTest, OcclusionForLayerWithUninvertibleDrawTransform) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; std::unique_ptr compositor_frame_sink = FakeCompositorFrameSink::Create3d(); - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr root = LayerImpl::Create(host_impl.active_tree(), 1); @@ -4838,10 +4830,9 @@ TEST_F(LayerTreeHostCommonTest, TransparentChildRenderSurfaceCreation) { TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl host_impl(host()->GetSettings(), &task_runner_provider, - &shared_bitmap_manager, &task_graph_runner); + &task_graph_runner); host_impl.CreatePendingTree(); std::unique_ptr root = LayerImpl::Create(host_impl.pending_tree(), 1); @@ -4943,7 +4934,6 @@ class LCDTextTest : public LayerTreeHostCommonTestBase, : LayerTreeHostCommonTestBase(LCDTextTestLayerTreeSettings()), host_impl_(LCDTextTestLayerTreeSettings(), &task_runner_provider_, - &shared_bitmap_manager_, &task_graph_runner_) {} scoped_refptr timeline() { return timeline_; } @@ -5002,7 +4992,6 @@ class LCDTextTest : public LayerTreeHostCommonTestBase, bool layers_always_allowed_lcd_text_; FakeImplTaskRunnerProvider task_runner_provider_; - TestSharedBitmapManager shared_bitmap_manager_; TestTaskGraphRunner task_graph_runner_; FakeLayerTreeHostImpl host_impl_; scoped_refptr timeline_; @@ -5160,10 +5149,8 @@ INSTANTIATE_TEST_CASE_P(LayerTreeHostCommonTest, TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayerImpl) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.CreatePendingTree(); std::unique_ptr root = @@ -5204,10 +5191,8 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayerImpl) { TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayersImpl) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.CreatePendingTree(); std::unique_ptr root = @@ -5248,10 +5233,8 @@ void EmptyCopyOutputCallback(std::unique_ptr result) {} TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.CreatePendingTree(); std::unique_ptr root = @@ -5394,10 +5377,8 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) { TEST_F(LayerTreeHostCommonTest, ClippedOutCopyRequest) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.CreatePendingTree(); std::unique_ptr root = @@ -5904,10 +5885,8 @@ TEST_F(LayerTreeHostCommonTest, TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr root = LayerImpl::Create(host_impl.active_tree(), 12345); @@ -6604,10 +6583,8 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) { // + fixed // FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.CreatePendingTree(); std::unique_ptr root_ptr = LayerImpl::Create(host_impl.active_tree(), 1); @@ -7635,12 +7612,11 @@ class AnimationScaleFactorTrackingLayerImpl : public LayerImpl { TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; LayerTreeSettings settings = host()->GetSettings(); settings.layer_transforms_should_scale_layer_contents = true; FakeLayerTreeHostImpl host_impl(settings, &task_runner_provider, - &shared_bitmap_manager, &task_graph_runner); + &task_graph_runner); std::unique_ptr grand_parent = AnimationScaleFactorTrackingLayerImpl::Create(host_impl.active_tree(), 1); std::unique_ptr parent = @@ -7893,10 +7869,8 @@ static void GatherDrawnLayers(const LayerImplList* rsll, TEST_F(LayerTreeHostCommonTest, RenderSurfaceLayerListMembership) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr grand_parent = LayerImpl::Create(host_impl.active_tree(), 1); @@ -8119,12 +8093,11 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceLayerListMembership) { TEST_F(LayerTreeHostCommonTest, DrawPropertyScales) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; LayerTreeSettings settings = host()->GetSettings(); settings.layer_transforms_should_scale_layer_contents = true; FakeLayerTreeHostImpl host_impl(settings, &task_runner_provider, - &shared_bitmap_manager, &task_graph_runner); + &task_graph_runner); std::unique_ptr root = LayerImpl::Create(host_impl.active_tree(), 1); @@ -8234,12 +8207,11 @@ TEST_F(LayerTreeHostCommonTest, DrawPropertyScales) { TEST_F(LayerTreeHostCommonTest, AnimationScales) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; LayerTreeSettings settings = host()->GetSettings(); settings.layer_transforms_should_scale_layer_contents = true; FakeLayerTreeHostImpl host_impl(settings, &task_runner_provider, - &shared_bitmap_manager, &task_graph_runner); + &task_graph_runner); std::unique_ptr root = LayerImpl::Create(host_impl.active_tree(), 1); @@ -8313,12 +8285,11 @@ TEST_F(LayerTreeHostCommonTest, // Returns empty scale if layer_transforms_should_scale_layer_contents is // false. FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; LayerTreeSettings settings = host()->GetSettings(); settings.layer_transforms_should_scale_layer_contents = false; FakeLayerTreeHostImpl host_impl(settings, &task_runner_provider, - &shared_bitmap_manager, &task_graph_runner); + &task_graph_runner); std::unique_ptr root = LayerImpl::Create(host_impl.active_tree(), 1); @@ -8393,10 +8364,8 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectInChildRenderSurface) { TEST_F(LayerTreeHostCommonTest, BoundsDeltaAffectVisibleContentRect) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); // Set two layers: the root layer clips it's child, // the child draws its content. @@ -9024,10 +8993,8 @@ TEST_F(LayerTreeHostCommonTest, SkippingSubtreeMain) { TEST_F(LayerTreeHostCommonTest, SkippingLayerImpl) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); std::unique_ptr root = LayerImpl::Create(host_impl.active_tree(), 1); @@ -9213,10 +9180,8 @@ TEST_F(LayerTreeHostCommonTest, LayerSkippingInSubtreeOfSingularTransform) { TEST_F(LayerTreeHostCommonTest, SkippingPendingLayerImpl) { FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &task_graph_runner); host_impl.CreatePendingTree(); std::unique_ptr root = diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index ead5db73d6b313..68453e15f9e7b1 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -172,15 +172,12 @@ std::unique_ptr LayerTreeHostImpl::Create( LayerTreeHostImplClient* client, TaskRunnerProvider* task_runner_provider, RenderingStatsInstrumentation* rendering_stats_instrumentation, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, std::unique_ptr animation_host, int id) { return base::WrapUnique(new LayerTreeHostImpl( settings, client, task_runner_provider, rendering_stats_instrumentation, - shared_bitmap_manager, gpu_memory_buffer_manager, task_graph_runner, - std::move(animation_host), id)); + task_graph_runner, std::move(animation_host), id)); } LayerTreeHostImpl::LayerTreeHostImpl( @@ -188,8 +185,6 @@ LayerTreeHostImpl::LayerTreeHostImpl( LayerTreeHostImplClient* client, TaskRunnerProvider* task_runner_provider, RenderingStatsInstrumentation* rendering_stats_instrumentation, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, std::unique_ptr animation_host, int id) @@ -233,8 +228,6 @@ LayerTreeHostImpl::LayerTreeHostImpl( animation_host_(std::move(animation_host)), rendering_stats_instrumentation_(rendering_stats_instrumentation), micro_benchmark_controller_(this), - shared_bitmap_manager_(shared_bitmap_manager), - gpu_memory_buffer_manager_(gpu_memory_buffer_manager), task_graph_runner_(task_graph_runner), id_(id), requires_high_res_to_draw_(false), @@ -2305,8 +2298,9 @@ bool LayerTreeHostImpl::InitializeRenderer( compositor_frame_sink_ = compositor_frame_sink; has_valid_compositor_frame_sink_ = true; resource_provider_ = base::MakeUnique( - compositor_frame_sink_->context_provider(), shared_bitmap_manager_, - gpu_memory_buffer_manager_, + compositor_frame_sink_->context_provider(), + compositor_frame_sink_->shared_bitmap_manager(), + compositor_frame_sink_->gpu_memory_buffer_manager(), task_runner_provider_->blocking_main_thread_task_runner(), settings_.renderer_settings.highp_threshold_min, settings_.renderer_settings.texture_id_allocation_chunk_size, diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 9bd3fc61babff2..661a6f2f3bc84e 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -149,8 +149,6 @@ class CC_EXPORT LayerTreeHostImpl LayerTreeHostImplClient* client, TaskRunnerProvider* task_runner_provider, RenderingStatsInstrumentation* rendering_stats_instrumentation, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, std::unique_ptr animation_host, int id); @@ -605,8 +603,6 @@ class CC_EXPORT LayerTreeHostImpl LayerTreeHostImplClient* client, TaskRunnerProvider* task_runner_provider, RenderingStatsInstrumentation* rendering_stats_instrumentation, - SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, TaskGraphRunner* task_graph_runner, std::unique_ptr animation_host, int id); @@ -815,8 +811,6 @@ class CC_EXPORT LayerTreeHostImpl // Optional callback to notify of new tree activations. base::Closure tree_activation_callback_; - SharedBitmapManager* shared_bitmap_manager_; - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; TaskGraphRunner* task_graph_runner_; int id_; diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index f1eee3c03f51de..a98eff09dad3f7 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -60,8 +60,6 @@ #include "cc/test/layer_test_common.h" #include "cc/test/layer_tree_test.h" #include "cc/test/test_compositor_frame_sink.h" -#include "cc/test/test_gpu_memory_buffer_manager.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/test/test_web_graphics_context_3d.h" #include "cc/trees/effect_node.h" @@ -195,7 +193,6 @@ class LayerTreeHostImplTest : public testing::Test, host_impl_->ReleaseCompositorFrameSink(); host_impl_ = LayerTreeHostImpl::Create( settings, this, task_runner_provider, &stats_instrumentation_, - &shared_bitmap_manager_, &gpu_memory_buffer_manager_, &task_graph_runner_, AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0); compositor_frame_sink_ = std::move(compositor_frame_sink); @@ -496,8 +493,6 @@ class LayerTreeHostImplTest : public testing::Test, FakeImplTaskRunnerProvider task_runner_provider_; DebugScopedSetMainThreadBlocked always_main_thread_blocked_; - TestSharedBitmapManager shared_bitmap_manager_; - TestGpuMemoryBufferManager gpu_memory_buffer_manager_; TestTaskGraphRunner task_graph_runner_; std::unique_ptr compositor_frame_sink_; std::unique_ptr host_impl_; @@ -2663,15 +2658,12 @@ class LayerTreeHostImplOverridePhysicalTime : public LayerTreeHostImpl { const LayerTreeSettings& settings, LayerTreeHostImplClient* client, TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* manager, TaskGraphRunner* task_graph_runner, RenderingStatsInstrumentation* rendering_stats_instrumentation) : LayerTreeHostImpl(settings, client, task_runner_provider, rendering_stats_instrumentation, - manager, - nullptr, task_graph_runner, AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0) {} @@ -2699,8 +2691,8 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest { LayerTreeHostImplOverridePhysicalTime* host_impl_override_time = new LayerTreeHostImplOverridePhysicalTime( - settings, this, &task_runner_provider_, &shared_bitmap_manager_, - &task_graph_runner_, &stats_instrumentation_); + settings, this, &task_runner_provider_, &task_graph_runner_, + &stats_instrumentation_); host_impl_ = base::WrapUnique(host_impl_override_time); compositor_frame_sink_ = CreateCompositorFrameSink(); host_impl_->SetVisible(true); @@ -7435,7 +7427,7 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) { std::unique_ptr layer_tree_host_impl = LayerTreeHostImpl::Create( settings, this, &task_runner_provider_, &stats_instrumentation_, - &shared_bitmap_manager_, NULL, &task_graph_runner_, + &task_graph_runner_, AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0); layer_tree_host_impl->SetVisible(true); layer_tree_host_impl->InitializeRenderer(compositor_frame_sink.get()); @@ -7558,15 +7550,14 @@ static std::unique_ptr SetupLayersForOpacity( bool partial_swap, LayerTreeHostImplClient* client, TaskRunnerProvider* task_runner_provider, - SharedBitmapManager* manager, TaskGraphRunner* task_graph_runner, RenderingStatsInstrumentation* stats_instrumentation, CompositorFrameSink* compositor_frame_sink) { settings.renderer_settings.partial_swap_enabled = partial_swap; std::unique_ptr my_host_impl = LayerTreeHostImpl::Create( - settings, client, task_runner_provider, stats_instrumentation, manager, - nullptr, task_graph_runner, - AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0); + settings, client, task_runner_provider, stats_instrumentation, + task_graph_runner, AnimationHost::CreateForTesting(ThreadInstance::IMPL), + 0); my_host_impl->SetVisible(true); my_host_impl->InitializeRenderer(compositor_frame_sink); my_host_impl->WillBeginImplFrame( @@ -7629,7 +7620,6 @@ static std::unique_ptr SetupLayersForOpacity( } TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorPartialSwap) { - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; scoped_refptr provider(TestContextProvider::Create()); provider->BindToCurrentThread(); @@ -7637,9 +7627,8 @@ TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorPartialSwap) { std::unique_ptr compositor_frame_sink( FakeCompositorFrameSink::Create3d(provider)); std::unique_ptr my_host_impl = SetupLayersForOpacity( - DefaultSettings(), true, this, &task_runner_provider_, - &shared_bitmap_manager, &task_graph_runner, &stats_instrumentation_, - compositor_frame_sink.get()); + DefaultSettings(), true, this, &task_runner_provider_, &task_graph_runner, + &stats_instrumentation_, compositor_frame_sink.get()); { LayerTreeHostImpl::FrameData frame; EXPECT_EQ(DRAW_SUCCESS, my_host_impl->PrepareToDraw(&frame)); @@ -7660,7 +7649,6 @@ TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorPartialSwap) { } TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorNoPartialSwap) { - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; scoped_refptr provider(TestContextProvider::Create()); provider->BindToCurrentThread(); @@ -7669,8 +7657,7 @@ TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorNoPartialSwap) { FakeCompositorFrameSink::Create3d(provider)); std::unique_ptr my_host_impl = SetupLayersForOpacity( DefaultSettings(), false, this, &task_runner_provider_, - &shared_bitmap_manager, &task_graph_runner, &stats_instrumentation_, - compositor_frame_sink.get()); + &task_graph_runner, &stats_instrumentation_, compositor_frame_sink.get()); { LayerTreeHostImpl::FrameData frame; EXPECT_EQ(DRAW_SUCCESS, my_host_impl->PrepareToDraw(&frame)); @@ -8040,7 +8027,7 @@ TEST_F(LayerTreeHostImplTest, MemoryLimits) { kSoftwareByteLimit, kSoftwareCutoff, kSoftwareResourceLimit); host_impl_ = LayerTreeHostImpl::Create( settings, this, &task_runner_provider_, &stats_instrumentation_, - &shared_bitmap_manager_, &gpu_memory_buffer_manager_, &task_graph_runner_, + &task_graph_runner_, AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0); // Gpu compositing. @@ -8155,9 +8142,8 @@ TEST_F(LayerTreeHostImplTest, RequireHighResAfterGpuRasterizationToggles) { class LayerTreeHostImplTestPrepareTiles : public LayerTreeHostImplTest { public: void SetUp() override { - fake_host_impl_ = - new FakeLayerTreeHostImpl(LayerTreeSettings(), &task_runner_provider_, - &shared_bitmap_manager_, &task_graph_runner_); + fake_host_impl_ = new FakeLayerTreeHostImpl( + LayerTreeSettings(), &task_runner_provider_, &task_graph_runner_); host_impl_.reset(fake_host_impl_); compositor_frame_sink_ = CreateCompositorFrameSink(); host_impl_->SetVisible(true); @@ -11516,7 +11502,7 @@ TEST_F(LayerTreeHostImplTest, RecomputeGpuRasterOnCompositorFrameSinkChange) { host_impl_ = LayerTreeHostImpl::Create( settings, this, &task_runner_provider_, &stats_instrumentation_, - &shared_bitmap_manager_, &gpu_memory_buffer_manager_, &task_graph_runner_, + &task_graph_runner_, AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0); host_impl_->SetVisible(true); diff --git a/cc/trees/layer_tree_host_in_process.cc b/cc/trees/layer_tree_host_in_process.cc index 8a97670e024575..3affe069842af0 100644 --- a/cc/trees/layer_tree_host_in_process.cc +++ b/cc/trees/layer_tree_host_in_process.cc @@ -214,8 +214,6 @@ LayerTreeHostInProcess::LayerTreeHostInProcess( gpu_rasterization_histogram_recorded_(false), did_complete_scale_animation_(false), id_(s_layer_tree_host_sequence_number.GetNext() + 1), - shared_bitmap_manager_(params->shared_bitmap_manager), - gpu_memory_buffer_manager_(params->gpu_memory_buffer_manager), task_graph_runner_(params->task_graph_runner), image_serialization_processor_(params->image_serialization_processor) { DCHECK(task_graph_runner_); @@ -562,14 +560,11 @@ LayerTreeHostInProcess::CreateLayerTreeHostImpl( std::unique_ptr host_impl = LayerTreeHostImpl::Create( settings_, client, task_runner_provider_.get(), - rendering_stats_instrumentation_.get(), shared_bitmap_manager_, - gpu_memory_buffer_manager_, task_graph_runner_, + rendering_stats_instrumentation_.get(), task_graph_runner_, std::move(animation_host_impl), id_); host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); host_impl->SetContentIsSuitableForGpuRasterization( content_is_suitable_for_gpu_rasterization_); - shared_bitmap_manager_ = NULL; - gpu_memory_buffer_manager_ = NULL; task_graph_runner_ = NULL; input_handler_weak_ptr_ = host_impl->AsWeakPtr(); return host_impl; diff --git a/cc/trees/layer_tree_host_in_process.h b/cc/trees/layer_tree_host_in_process.h index 5eed0099e70a0e..9e95974e991940 100644 --- a/cc/trees/layer_tree_host_in_process.h +++ b/cc/trees/layer_tree_host_in_process.h @@ -45,10 +45,6 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/gfx/geometry/rect.h" -namespace gpu { -class GpuMemoryBufferManager; -} // namespace gpu - namespace cc { class AnimationHost; class AnimationEvents; @@ -69,7 +65,6 @@ class RemoteProtoChannel; class RenderingStatsInstrumentation; class ResourceProvider; class ResourceUpdateQueue; -class SharedBitmapManager; class TaskGraphRunner; struct PendingPageScaleAnimation; struct RenderingStats; @@ -85,8 +80,6 @@ class CC_EXPORT LayerTreeHostInProcess : public LayerTreeHost { // std::move()d to the Create* functions. struct CC_EXPORT InitParams { LayerTreeHostClient* client = nullptr; - SharedBitmapManager* shared_bitmap_manager = nullptr; - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr; TaskGraphRunner* task_graph_runner = nullptr; LayerTreeSettings const* settings = nullptr; scoped_refptr main_task_runner; @@ -97,7 +90,6 @@ class CC_EXPORT LayerTreeHostInProcess : public LayerTreeHost { ~InitParams(); }; - // The SharedBitmapManager will be used on the compositor thread. static std::unique_ptr CreateThreaded( scoped_refptr impl_task_runner, InitParams* params); @@ -275,15 +267,8 @@ class CC_EXPORT LayerTreeHostInProcess : public LayerTreeHost { void SetUIResourceManagerForTesting( std::unique_ptr ui_resource_manager); - // shared_bitmap_manager(), gpu_memory_buffer_manager(), and - // task_graph_runner() return valid values only until the LayerTreeHostImpl is - // created in CreateLayerTreeHostImpl(). - SharedBitmapManager* shared_bitmap_manager() const { - return shared_bitmap_manager_; - } - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const { - return gpu_memory_buffer_manager_; - } + // task_graph_runner() returns a valid value only until the LayerTreeHostImpl + // is created in CreateLayerTreeHostImpl(). TaskGraphRunner* task_graph_runner() const { return task_graph_runner_; } void OnCommitForSwapPromises(); @@ -355,8 +340,6 @@ class CC_EXPORT LayerTreeHostInProcess : public LayerTreeHost { bool next_commit_forces_redraw_ = false; bool next_commit_forces_recalculate_raster_scales_ = false; - SharedBitmapManager* shared_bitmap_manager_; - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; TaskGraphRunner* task_graph_runner_; ImageSerializationProcessor* image_serialization_processor_; diff --git a/cc/trees/layer_tree_host_pixeltest_tiles.cc b/cc/trees/layer_tree_host_pixeltest_tiles.cc index 67342e2115120d..9a649dcece9c5b 100644 --- a/cc/trees/layer_tree_host_pixeltest_tiles.cc +++ b/cc/trees/layer_tree_host_pixeltest_tiles.cc @@ -11,7 +11,6 @@ #include "cc/playback/display_item_list_settings.h" #include "cc/playback/drawing_display_item.h" #include "cc/test/layer_tree_pixel_test.h" -#include "cc/test/test_gpu_memory_buffer_manager.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index d5acd402682bad..3624529adf471d 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -50,7 +50,6 @@ #include "cc/test/render_pass_test_utils.h" #include "cc/test/skia_common.h" #include "cc/test/test_compositor_frame_sink.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_web_graphics_context_3d.h" #include "cc/trees/effect_node.h" #include "cc/trees/layer_tree_host_common.h" diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc index 63ecb57a240b47..10e17abf33fa0b 100644 --- a/cc/trees/layer_tree_host_unittest_scroll.cc +++ b/cc/trees/layer_tree_host_unittest_scroll.cc @@ -21,7 +21,6 @@ #include "cc/test/fake_picture_layer_impl.h" #include "cc/test/geometry_test_utils.h" #include "cc/test/layer_tree_test.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/layer_tree_impl.h" #include "cc/trees/scroll_node.h" @@ -1308,12 +1307,10 @@ TEST(LayerTreeHostFlingTest, DidStopFlingingThread) { LayerTreeSettings settings; StubLayerTreeHostClient layer_tree_host_client; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; LayerTreeHostInProcess::InitParams params; params.client = &layer_tree_host_client; - params.shared_bitmap_manager = &shared_bitmap_manager; params.task_graph_runner = &task_graph_runner; params.settings = &settings; params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc index f656634636a169..1f1105621fb4e6 100644 --- a/cc/trees/tree_synchronizer_unittest.cc +++ b/cc/trees/tree_synchronizer_unittest.cc @@ -20,7 +20,6 @@ #include "cc/test/fake_layer_tree_host.h" #include "cc/test/fake_rendering_stats_instrumentation.h" #include "cc/test/stub_layer_tree_host_single_thread_client.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "cc/trees/effect_node.h" #include "cc/trees/layer_tree_host_common.h" @@ -483,7 +482,6 @@ TEST_F(TreeSynchronizerTest, SynchronizeCurrentlyScrollingNode) { FakeLayerTreeHostImplClient client; FakeImplTaskRunnerProvider task_runner_provider; FakeRenderingStatsInstrumentation stats_instrumentation; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl* host_impl = host_->host_impl(); host_impl->CreatePendingTree(); @@ -531,7 +529,6 @@ TEST_F(TreeSynchronizerTest, SynchronizeScrollTreeScrollOffsetMap) { FakeLayerTreeHostImplClient client; FakeImplTaskRunnerProvider task_runner_provider; FakeRenderingStatsInstrumentation stats_instrumentation; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl* host_impl = host_->host_impl(); host_impl->CreatePendingTree(); @@ -627,7 +624,6 @@ TEST_F(TreeSynchronizerTest, RefreshPropertyTreesCachedData) { FakeLayerTreeHostImplClient client; FakeImplTaskRunnerProvider task_runner_provider; FakeRenderingStatsInstrumentation stats_instrumentation; - TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl* host_impl = host_->host_impl(); host_impl->CreatePendingTree(); diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc index 71a1dcc40f251b..4b80fd590878d7 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc @@ -514,8 +514,8 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( display_output_surface = base::MakeUnique( compositor->window(), context_provider, - compositor->vsync_manager(), begin_frame_source.get(), - std::move(validator)); + GetGpuMemoryBufferManager(), compositor->vsync_manager(), + begin_frame_source.get(), std::move(validator)); #else NOTREACHED(); #endif @@ -560,7 +560,8 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( : base::MakeUnique( compositor->frame_sink_id(), surface_manager_.get(), data->display.get(), context_provider, - shared_worker_context_provider_); + shared_worker_context_provider_, GetGpuMemoryBufferManager(), + HostSharedBitmapManager::current()); data->display->Resize(compositor->size()); data->display->SetOutputIsSecure(data->output_is_secure); compositor->SetCompositorFrameSink(std::move(compositor_frame_sink)); @@ -633,10 +634,6 @@ uint32_t GpuProcessTransportFactory::GetImageTextureTarget( return BrowserGpuMemoryBufferManager::GetImageTextureTarget(format, usage); } -cc::SharedBitmapManager* GpuProcessTransportFactory::GetSharedBitmapManager() { - return HostSharedBitmapManager::current(); -} - gpu::GpuMemoryBufferManager* GpuProcessTransportFactory::GetGpuMemoryBufferManager() { return gpu_channel_factory_->GetGpuMemoryBufferManager(); diff --git a/content/browser/compositor/gpu_process_transport_factory.h b/content/browser/compositor/gpu_process_transport_factory.h index 74164396fb367e..e0985b02aa2b6e 100644 --- a/content/browser/compositor/gpu_process_transport_factory.h +++ b/content/browser/compositor/gpu_process_transport_factory.h @@ -59,7 +59,6 @@ class GpuProcessTransportFactory bool DoesCreateTestContexts() override; uint32_t GetImageTextureTarget(gfx::BufferFormat format, gfx::BufferUsage usage) override; - cc::SharedBitmapManager* GetSharedBitmapManager() override; gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; cc::TaskGraphRunner* GetTaskGraphRunner() override; cc::FrameSinkId AllocateFrameSinkId() override; diff --git a/content/browser/compositor/mus_browser_compositor_output_surface.cc b/content/browser/compositor/mus_browser_compositor_output_surface.cc index 8f2ee8b241c443..1b1f6c5a77fe82 100644 --- a/content/browser/compositor/mus_browser_compositor_output_surface.cc +++ b/content/browser/compositor/mus_browser_compositor_output_surface.cc @@ -22,6 +22,7 @@ namespace content { MusBrowserCompositorOutputSurface::MusBrowserCompositorOutputSurface( ui::Window* window, scoped_refptr context, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, scoped_refptr vsync_manager, cc::SyntheticBeginFrameSource* begin_frame_source, std::unique_ptr @@ -32,7 +33,8 @@ MusBrowserCompositorOutputSurface::MusBrowserCompositorOutputSurface( std::move(overlay_candidate_validator)), ui_window_(window) { ui_compositor_frame_sink_ = ui_window_->RequestCompositorFrameSink( - ui::mojom::CompositorFrameSinkType::DEFAULT, context); + ui::mojom::CompositorFrameSinkType::DEFAULT, context, + gpu_memory_buffer_manager); ui_compositor_frame_sink_->BindToClient(this); } diff --git a/content/browser/compositor/mus_browser_compositor_output_surface.h b/content/browser/compositor/mus_browser_compositor_output_surface.h index 81fff78afceeaa..2bb2a5d8f095f0 100644 --- a/content/browser/compositor/mus_browser_compositor_output_surface.h +++ b/content/browser/compositor/mus_browser_compositor_output_surface.h @@ -14,6 +14,10 @@ #include "gpu/command_buffer/common/mailbox.h" #include "gpu/ipc/common/surface_handle.h" +namespace gpu { +class GpuMemoryBufferManager; +} + namespace ui { class Window; class WindowCompositorFrameSink; @@ -31,6 +35,7 @@ class MusBrowserCompositorOutputSurface MusBrowserCompositorOutputSurface( ui::Window* window, scoped_refptr context, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, scoped_refptr vsync_manager, cc::SyntheticBeginFrameSource* begin_frame_source, std::unique_ptr diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc index c8363d6ea73112..610d0234c699af 100644 --- a/content/browser/renderer_host/compositor_impl_android.cc +++ b/content/browser/renderer_host/compositor_impl_android.cc @@ -508,8 +508,6 @@ void CompositorImpl::CreateLayerTreeHost() { cc::LayerTreeHostInProcess::InitParams params; params.client = this; - params.shared_bitmap_manager = HostSharedBitmapManager::current(); - params.gpu_memory_buffer_manager = BrowserGpuMemoryBufferManager::current(); params.task_graph_runner = g_task_graph_runner.Pointer(); params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); params.settings = &settings; @@ -723,12 +721,14 @@ void CompositorImpl::InitializeDisplay( base::MakeUnique(task_runner))); auto compositor_frame_sink = - vulkan_context_provider ? base::MakeUnique( - frame_sink_id_, manager, display_.get(), - vulkan_context_provider) - : base::MakeUnique( - frame_sink_id_, manager, display_.get(), - context_provider, nullptr); + vulkan_context_provider + ? base::MakeUnique( + frame_sink_id_, manager, display_.get(), + vulkan_context_provider) + : base::MakeUnique( + frame_sink_id_, manager, display_.get(), context_provider, + nullptr, BrowserGpuMemoryBufferManager::current(), + HostSharedBitmapManager::current()); display_->SetVisible(true); display_->Resize(size_); diff --git a/content/browser/renderer_host/context_provider_factory_impl_android.cc b/content/browser/renderer_host/context_provider_factory_impl_android.cc index b59cf60efee194..0232b2ac4cbce2 100644 --- a/content/browser/renderer_host/context_provider_factory_impl_android.cc +++ b/content/browser/renderer_host/context_provider_factory_impl_android.cc @@ -138,10 +138,6 @@ cc::FrameSinkId ContextProviderFactoryImpl::AllocateFrameSinkId() { return cc::FrameSinkId(++next_client_id_, 0 /* sink_id */); } -cc::SharedBitmapManager* ContextProviderFactoryImpl::GetSharedBitmapManager() { - return HostSharedBitmapManager::current(); -} - gpu::GpuMemoryBufferManager* ContextProviderFactoryImpl::GetGpuMemoryBufferManager() { return BrowserGpuMemoryBufferManager::current(); diff --git a/content/browser/renderer_host/context_provider_factory_impl_android.h b/content/browser/renderer_host/context_provider_factory_impl_android.h index a08c71339d7a7b..2adc8cfcdf2a7c 100644 --- a/content/browser/renderer_host/context_provider_factory_impl_android.h +++ b/content/browser/renderer_host/context_provider_factory_impl_android.h @@ -64,7 +64,6 @@ class CONTENT_EXPORT ContextProviderFactoryImpl scoped_refptr gpu_channel_host) override; cc::SurfaceManager* GetSurfaceManager() override; cc::FrameSinkId AllocateFrameSinkId() override; - cc::SharedBitmapManager* GetSharedBitmapManager() override; gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; private: diff --git a/content/renderer/android/synchronous_compositor_frame_sink.cc b/content/renderer/android/synchronous_compositor_frame_sink.cc index 32b07eb2bc472d..7bcd562d1e0559 100644 --- a/content/renderer/android/synchronous_compositor_frame_sink.cc +++ b/content/renderer/android/synchronous_compositor_frame_sink.cc @@ -104,13 +104,16 @@ class SynchronousCompositorFrameSink::SoftwareOutputSurface SynchronousCompositorFrameSink::SynchronousCompositorFrameSink( scoped_refptr context_provider, scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, int routing_id, uint32_t compositor_frame_sink_id, std::unique_ptr begin_frame_source, SynchronousCompositorRegistry* registry, scoped_refptr frame_swap_message_queue) : cc::CompositorFrameSink(std::move(context_provider), - std::move(worker_context_provider)), + std::move(worker_context_provider), + gpu_memory_buffer_manager, + nullptr), routing_id_(routing_id), compositor_frame_sink_id_(compositor_frame_sink_id), registry_(registry), diff --git a/content/renderer/android/synchronous_compositor_frame_sink.h b/content/renderer/android/synchronous_compositor_frame_sink.h index 4446fa0dfde44e..37fe19e96466c2 100644 --- a/content/renderer/android/synchronous_compositor_frame_sink.h +++ b/content/renderer/android/synchronous_compositor_frame_sink.h @@ -71,6 +71,7 @@ class SynchronousCompositorFrameSink SynchronousCompositorFrameSink( scoped_refptr context_provider, scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, int routing_id, uint32_t compositor_frame_sink_id, std::unique_ptr begin_frame_source, diff --git a/content/renderer/gpu/compositor_dependencies.h b/content/renderer/gpu/compositor_dependencies.h index 17458ecfaa9fd2..0ba2a39a773fdb 100644 --- a/content/renderer/gpu/compositor_dependencies.h +++ b/content/renderer/gpu/compositor_dependencies.h @@ -19,14 +19,9 @@ namespace cc { class BeginFrameSource; class ContextProvider; class ImageSerializationProcessor; -class SharedBitmapManager; class TaskGraphRunner; } -namespace gpu { -class GpuMemoryBufferManager; -} - namespace blink { namespace scheduler { class RendererScheduler; @@ -54,8 +49,6 @@ class CompositorDependencies { // compositor thread). virtual scoped_refptr GetCompositorImplThreadTaskRunner() = 0; - virtual cc::SharedBitmapManager* GetSharedBitmapManager() = 0; - virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; virtual blink::scheduler::RendererScheduler* GetRendererScheduler() = 0; virtual cc::ImageSerializationProcessor* GetImageSerializationProcessor() = 0; virtual cc::TaskGraphRunner* GetTaskGraphRunner() = 0; diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index d4914f899600f6..344f7abe32216e 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -261,9 +261,6 @@ void RenderWidgetCompositor::Initialize(float device_scale_factor) { cc::LayerTreeHostInProcess::InitParams params; params.client = this; - params.shared_bitmap_manager = compositor_deps_->GetSharedBitmapManager(); - params.gpu_memory_buffer_manager = - compositor_deps_->GetGpuMemoryBufferManager(); params.settings = &settings; params.task_graph_runner = compositor_deps_->GetTaskGraphRunner(); params.main_task_runner = diff --git a/content/renderer/gpu/renderer_compositor_frame_sink.cc b/content/renderer/gpu/renderer_compositor_frame_sink.cc index 51f1106e23e204..1f80675a3677e8 100644 --- a/content/renderer/gpu/renderer_compositor_frame_sink.cc +++ b/content/renderer/gpu/renderer_compositor_frame_sink.cc @@ -32,9 +32,13 @@ RendererCompositorFrameSink::RendererCompositorFrameSink( std::unique_ptr begin_frame_source, scoped_refptr context_provider, scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + cc::SharedBitmapManager* shared_bitmap_manager, scoped_refptr swap_frame_message_queue) : CompositorFrameSink(std::move(context_provider), - std::move(worker_context_provider)), + std::move(worker_context_provider), + gpu_memory_buffer_manager, + shared_bitmap_manager), compositor_frame_sink_id_(compositor_frame_sink_id), compositor_frame_sink_filter_( RenderThreadImpl::current()->compositor_message_filter()), diff --git a/content/renderer/gpu/renderer_compositor_frame_sink.h b/content/renderer/gpu/renderer_compositor_frame_sink.h index 8b2254c3ba8668..9cc71452fbb3a4 100644 --- a/content/renderer/gpu/renderer_compositor_frame_sink.h +++ b/content/renderer/gpu/renderer_compositor_frame_sink.h @@ -49,6 +49,8 @@ class RendererCompositorFrameSink std::unique_ptr begin_frame_source, scoped_refptr context_provider, scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + cc::SharedBitmapManager* shared_bitmap_manager, scoped_refptr swap_frame_message_queue); RendererCompositorFrameSink( int32_t routing_id, diff --git a/content/renderer/layout_test_dependencies.h b/content/renderer/layout_test_dependencies.h index 52941a5596f4a9..f01a881a59ca32 100644 --- a/content/renderer/layout_test_dependencies.h +++ b/content/renderer/layout_test_dependencies.h @@ -14,11 +14,13 @@ namespace cc { class ContextProvider; class CopyOutputRequest; class CompositorFrameSink; +class SharedBitmapManager; class SwapPromise; } namespace gpu { class GpuChannelHost; +class GpuMemoryBufferManager; } namespace content { @@ -33,6 +35,7 @@ class LayoutTestDependencies { scoped_refptr gpu_channel, scoped_refptr compositor_context_provider, scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, CompositorDependencies* deps) = 0; // Returns a SwapPromise which should be queued for the next compositor frame. diff --git a/content/renderer/mus/render_widget_mus_connection.cc b/content/renderer/mus/render_widget_mus_connection.cc index c5633ad3b8ed38..80464706d3b82a 100644 --- a/content/renderer/mus/render_widget_mus_connection.cc +++ b/content/renderer/mus/render_widget_mus_connection.cc @@ -40,7 +40,8 @@ void RenderWidgetMusConnection::Bind( std::unique_ptr RenderWidgetMusConnection::CreateCompositorFrameSink( - scoped_refptr gpu_channel_host) { + scoped_refptr gpu_channel_host, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(!window_compositor_frame_sink_binding_); @@ -48,7 +49,7 @@ RenderWidgetMusConnection::CreateCompositorFrameSink( ui::WindowCompositorFrameSink::Create( make_scoped_refptr( new ui::ContextProvider(std::move(gpu_channel_host))), - &window_compositor_frame_sink_binding_)); + gpu_memory_buffer_manager, &window_compositor_frame_sink_binding_)); if (compositor_mus_connection_) { compositor_mus_connection_->AttachCompositorFrameSinkOnMainThread( std::move(window_compositor_frame_sink_binding_)); diff --git a/content/renderer/mus/render_widget_mus_connection.h b/content/renderer/mus/render_widget_mus_connection.h index 3b8576a98a6cea..52bc96614abf31 100644 --- a/content/renderer/mus/render_widget_mus_connection.h +++ b/content/renderer/mus/render_widget_mus_connection.h @@ -14,6 +14,7 @@ namespace gpu { class GpuChannelHost; +class GpuMemoryBufferManager; } namespace content { @@ -29,7 +30,8 @@ class CONTENT_EXPORT RenderWidgetMusConnection // Create a cc output surface. std::unique_ptr CreateCompositorFrameSink( - scoped_refptr gpu_channel_host); + scoped_refptr gpu_channel_host, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); static RenderWidgetMusConnection* Get(int routing_id); diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 7296ab1965a7c5..8ea4bb12aade59 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -1948,7 +1948,8 @@ RenderThreadImpl::CreateCompositorFrameSink( RenderWidgetMusConnection::GetOrCreate(routing_id); scoped_refptr gpu_channel_host = EstablishGpuChannelSync(); - return connection->CreateCompositorFrameSink(std::move(gpu_channel_host)); + return connection->CreateCompositorFrameSink(std::move(gpu_channel_host), + GetGpuMemoryBufferManager()); } #endif @@ -1986,8 +1987,8 @@ RenderThreadImpl::CreateCompositorFrameSink( DCHECK(!layout_test_mode()); return base::MakeUnique( routing_id, compositor_frame_sink_id, - CreateExternalBeginFrameSource(routing_id), nullptr, nullptr, - std::move(frame_swap_message_queue)); + CreateExternalBeginFrameSource(routing_id), nullptr, nullptr, nullptr, + shared_bitmap_manager(), std::move(frame_swap_message_queue)); } scoped_refptr worker_context_provider = @@ -2032,14 +2033,15 @@ RenderThreadImpl::CreateCompositorFrameSink( if (layout_test_deps_) { return layout_test_deps_->CreateCompositorFrameSink( routing_id, std::move(gpu_channel_host), std::move(context_provider), - std::move(worker_context_provider), this); + std::move(worker_context_provider), GetGpuMemoryBufferManager(), + this); } #if defined(OS_ANDROID) if (sync_compositor_message_filter_) { return base::MakeUnique( std::move(context_provider), std::move(worker_context_provider), - routing_id, compositor_frame_sink_id, + GetGpuMemoryBufferManager(), routing_id, compositor_frame_sink_id, CreateExternalBeginFrameSource(routing_id), sync_compositor_message_filter_.get(), std::move(frame_swap_message_queue)); @@ -2048,7 +2050,8 @@ RenderThreadImpl::CreateCompositorFrameSink( return base::WrapUnique(new RendererCompositorFrameSink( routing_id, compositor_frame_sink_id, CreateExternalBeginFrameSource(routing_id), std::move(context_provider), - std::move(worker_context_provider), std::move(frame_swap_message_queue))); + std::move(worker_context_provider), GetGpuMemoryBufferManager(), + nullptr, std::move(frame_swap_message_queue))); } AssociatedInterfaceRegistry* diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index 7ee58e57b4de85..6292b9129a46bf 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h @@ -233,7 +233,6 @@ class CONTENT_EXPORT RenderThreadImpl GetCompositorMainThreadTaskRunner() override; scoped_refptr GetCompositorImplThreadTaskRunner() override; - gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; blink::scheduler::RendererScheduler* GetRendererScheduler() override; cc::ImageSerializationProcessor* GetImageSerializationProcessor() override; cc::TaskGraphRunner* GetTaskGraphRunner() override; @@ -249,6 +248,8 @@ class CONTENT_EXPORT RenderThreadImpl // time this routine returns. scoped_refptr EstablishGpuChannelSync(); + gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager(); + std::unique_ptr CreateCompositorFrameSink( bool use_software, int routing_id, diff --git a/content/test/fake_compositor_dependencies.cc b/content/test/fake_compositor_dependencies.cc index 991123c2be68db..a59e615a14d366 100644 --- a/content/test/fake_compositor_dependencies.cc +++ b/content/test/fake_compositor_dependencies.cc @@ -75,15 +75,6 @@ FakeCompositorDependencies::GetCompositorImplThreadTaskRunner() { return nullptr; // Currently never threaded compositing in unit tests. } -cc::SharedBitmapManager* FakeCompositorDependencies::GetSharedBitmapManager() { - return &shared_bitmap_manager_; -} - -gpu::GpuMemoryBufferManager* -FakeCompositorDependencies::GetGpuMemoryBufferManager() { - return &gpu_memory_buffer_manager_; -} - blink::scheduler::RendererScheduler* FakeCompositorDependencies::GetRendererScheduler() { return &renderer_scheduler_; diff --git a/content/test/fake_compositor_dependencies.h b/content/test/fake_compositor_dependencies.h index 2a6537bbb21dd0..26246775f0df62 100644 --- a/content/test/fake_compositor_dependencies.h +++ b/content/test/fake_compositor_dependencies.h @@ -7,8 +7,6 @@ #include "base/macros.h" #include "cc/output/buffer_to_texture_target_map.h" -#include "cc/test/test_gpu_memory_buffer_manager.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "content/renderer/gpu/compositor_dependencies.h" #include "third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h" @@ -36,8 +34,6 @@ class FakeCompositorDependencies : public CompositorDependencies { GetCompositorMainThreadTaskRunner() override; scoped_refptr GetCompositorImplThreadTaskRunner() override; - cc::SharedBitmapManager* GetSharedBitmapManager() override; - gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; blink::scheduler::RendererScheduler* GetRendererScheduler() override; cc::ImageSerializationProcessor* GetImageSerializationProcessor() override; cc::TaskGraphRunner* GetTaskGraphRunner() override; @@ -45,8 +41,6 @@ class FakeCompositorDependencies : public CompositorDependencies { bool IsThreadedAnimationEnabled() override; private: - cc::TestSharedBitmapManager shared_bitmap_manager_; - cc::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; cc::TestTaskGraphRunner task_graph_runner_; blink::scheduler::FakeRendererScheduler renderer_scheduler_; cc::BufferToTextureTargetMap buffer_to_texture_target_map_; diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc index df166e20fcd1ee..9051eae9901965 100644 --- a/content/test/layouttest_support.cc +++ b/content/test/layouttest_support.cc @@ -329,6 +329,7 @@ class LayoutTestDependenciesImpl : public LayoutTestDependencies, scoped_refptr gpu_channel, scoped_refptr compositor_context_provider, scoped_refptr worker_context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, CompositorDependencies* deps) override { // This could override the GpuChannel for a CompositorFrameSink that was // previously being created but in that case the old GpuChannel would be @@ -346,10 +347,9 @@ class LayoutTestDependenciesImpl : public LayoutTestDependencies, auto compositor_frame_sink = base::MakeUnique( std::move(compositor_context_provider), - std::move(worker_context_provider), deps->GetSharedBitmapManager(), - deps->GetGpuMemoryBufferManager(), settings.renderer_settings, - task_runner, synchronous_composite, - false /* force_disable_reclaim_resources */); + std::move(worker_context_provider), nullptr /* shared_bitmap_manager */, + gpu_memory_buffer_manager, settings.renderer_settings, task_runner, + synchronous_composite, false /* force_disable_reclaim_resources */); compositor_frame_sink->SetClient(this); compositor_frame_sinks_[routing_id] = compositor_frame_sink.get(); return std::move(compositor_frame_sink); diff --git a/services/ui/demo/bitmap_uploader.cc b/services/ui/demo/bitmap_uploader.cc index a0c7b3f775d1f2..1f34310322673b 100644 --- a/services/ui/demo/bitmap_uploader.cc +++ b/services/ui/demo/bitmap_uploader.cc @@ -40,7 +40,8 @@ BitmapUploader::BitmapUploader(Window* window) void BitmapUploader::Init(ui::GpuService* gpu_service) { gpu_service->EstablishGpuChannel(base::Bind( - &BitmapUploader::OnGpuChannelEstablished, weak_factory_.GetWeakPtr())); + &BitmapUploader::OnGpuChannelEstablished, weak_factory_.GetWeakPtr(), + gpu_service->gpu_memory_buffer_manager())); } BitmapUploader::~BitmapUploader() { @@ -173,10 +174,11 @@ void BitmapUploader::Upload() { } void BitmapUploader::OnGpuChannelEstablished( + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, scoped_refptr gpu_channel) { compositor_frame_sink_ = window_->RequestCompositorFrameSink( mojom::CompositorFrameSinkType::DEFAULT, - new ContextProvider(std::move(gpu_channel))); + new ContextProvider(std::move(gpu_channel)), gpu_memory_buffer_manager); compositor_frame_sink_->BindToClient(this); } diff --git a/services/ui/demo/bitmap_uploader.h b/services/ui/demo/bitmap_uploader.h index a2a764298d0bdd..7a22bb0f96adaa 100644 --- a/services/ui/demo/bitmap_uploader.h +++ b/services/ui/demo/bitmap_uploader.h @@ -54,7 +54,9 @@ class BitmapUploader : public cc::CompositorFrameSinkClient { private: void Upload(); - void OnGpuChannelEstablished(scoped_refptr gpu_channel); + void OnGpuChannelEstablished( + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, + scoped_refptr gpu_channel); uint32_t BindTextureForSize(const gfx::Size& size); diff --git a/services/ui/public/cpp/window.cc b/services/ui/public/cpp/window.cc index bd4470907165b1..4368a2601a6915 100644 --- a/services/ui/public/cpp/window.cc +++ b/services/ui/public/cpp/window.cc @@ -271,11 +271,13 @@ bool Window::IsDrawn() const { std::unique_ptr Window::RequestCompositorFrameSink( mojom::CompositorFrameSinkType type, - scoped_refptr context_provider) { + scoped_refptr context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { std::unique_ptr compositor_frame_sink_binding; std::unique_ptr compositor_frame_sink = WindowCompositorFrameSink::Create(std::move(context_provider), + gpu_memory_buffer_manager, &compositor_frame_sink_binding); AttachCompositorFrameSink(type, std::move(compositor_frame_sink_binding)); return compositor_frame_sink; diff --git a/services/ui/public/cpp/window.h b/services/ui/public/cpp/window.h index 733c58b38faa43..d2d66387c2018e 100644 --- a/services/ui/public/cpp/window.h +++ b/services/ui/public/cpp/window.h @@ -25,6 +25,10 @@ namespace gfx { class Size; } +namespace gpu { +class GpuMemoryBufferManager; +} + namespace ui { class InputEventHandler; @@ -117,7 +121,8 @@ class Window { std::unique_ptr RequestCompositorFrameSink( mojom::CompositorFrameSinkType type, - scoped_refptr context_provider); + scoped_refptr context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); void AttachCompositorFrameSink( mojom::CompositorFrameSinkType type, diff --git a/services/ui/public/cpp/window_compositor_frame_sink.cc b/services/ui/public/cpp/window_compositor_frame_sink.cc index 36e1dea6efacdd..9cd9e2803cb281 100644 --- a/services/ui/public/cpp/window_compositor_frame_sink.cc +++ b/services/ui/public/cpp/window_compositor_frame_sink.cc @@ -15,6 +15,7 @@ namespace ui { // static std::unique_ptr WindowCompositorFrameSink::Create( scoped_refptr context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, std::unique_ptr* compositor_frame_sink_binding) { cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink; @@ -27,7 +28,8 @@ std::unique_ptr WindowCompositorFrameSink::Create( GetProxy(&compositor_frame_sink), compositor_frame_sink_client.PassInterface())); return base::WrapUnique(new WindowCompositorFrameSink( - std::move(context_provider), compositor_frame_sink.PassInterface(), + std::move(context_provider), gpu_memory_buffer_manager, + compositor_frame_sink.PassInterface(), std::move(compositor_frame_sink_client_request))); } @@ -72,10 +74,14 @@ void WindowCompositorFrameSink::SubmitCompositorFrame( WindowCompositorFrameSink::WindowCompositorFrameSink( scoped_refptr context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, mojo::InterfacePtrInfo compositor_frame_sink_info, cc::mojom::MojoCompositorFrameSinkClientRequest client_request) - : cc::CompositorFrameSink(std::move(context_provider), nullptr), + : cc::CompositorFrameSink(std::move(context_provider), + nullptr, + gpu_memory_buffer_manager, + nullptr), compositor_frame_sink_info_(std::move(compositor_frame_sink_info)), client_request_(std::move(client_request)) {} diff --git a/services/ui/public/cpp/window_compositor_frame_sink.h b/services/ui/public/cpp/window_compositor_frame_sink.h index 88a7df872c03b3..2bb98687125879 100644 --- a/services/ui/public/cpp/window_compositor_frame_sink.h +++ b/services/ui/public/cpp/window_compositor_frame_sink.h @@ -28,6 +28,7 @@ class WindowCompositorFrameSink // static static std::unique_ptr Create( scoped_refptr context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, std::unique_ptr* compositor_frame_sink_binding); @@ -43,6 +44,7 @@ class WindowCompositorFrameSink WindowCompositorFrameSink( scoped_refptr context_provider, + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, mojo::InterfacePtrInfo compositor_frame_sink_info, cc::mojom::MojoCompositorFrameSinkClientRequest client_request); diff --git a/third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp b/third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp index 57400b019e86e2..420a01290ea5e7 100644 --- a/third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp @@ -36,7 +36,6 @@ class CompositorMutableStateTest : public testing::Test { LayerTreeSettings settings; settings.layer_transforms_should_scale_layer_contents = true; m_hostImpl.reset(new FakeLayerTreeHostImpl(settings, &m_taskRunnerProvider, - &m_sharedBitmapManager, &m_taskGraphRunner)); m_hostImpl->SetVisible(true); EXPECT_TRUE(m_hostImpl->InitializeRenderer(m_compositorFrameSink.get())); @@ -61,7 +60,6 @@ class CompositorMutableStateTest : public testing::Test { // message loop (one example is the task runner provider). We construct one // here so that it's installed in TLA and can be found by other cc classes. base::MessageLoop m_messageLoop; - TestSharedBitmapManager m_sharedBitmapManager; TestTaskGraphRunner m_taskGraphRunner; FakeImplTaskRunnerProvider m_taskRunnerProvider; std::unique_ptr m_compositorFrameSink; diff --git a/ui/android/context_provider_factory.h b/ui/android/context_provider_factory.h index 294f101c0fb528..f216245e528f88 100644 --- a/ui/android/context_provider_factory.h +++ b/ui/android/context_provider_factory.h @@ -12,7 +12,6 @@ namespace cc { class ContextProvider; -class GpuMemoryBufferManager; class VulkanContextProvider; class SharedBitmapManager; class SurfaceManager; @@ -83,8 +82,6 @@ class UI_ANDROID_EXPORT ContextProviderFactory { virtual cc::FrameSinkId AllocateFrameSinkId() = 0; - virtual cc::SharedBitmapManager* GetSharedBitmapManager() = 0; - virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; }; diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc index ac62dbfe812144..55c51c61e4fefe 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc @@ -187,9 +187,6 @@ Compositor::Compositor(ui::ContextFactory* context_factory, cc::LayerTreeHostInProcess::InitParams params; params.client = this; - params.shared_bitmap_manager = context_factory_->GetSharedBitmapManager(); - params.gpu_memory_buffer_manager = - context_factory_->GetGpuMemoryBufferManager(); params.task_graph_runner = context_factory_->GetTaskGraphRunner(); params.settings = &settings; params.main_task_runner = task_runner_; diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h index 783bdb2e1bb224..e67701814ae004 100644 --- a/ui/compositor/compositor.h +++ b/ui/compositor/compositor.h @@ -44,7 +44,6 @@ class Layer; class LayerTreeDebugState; class LayerTreeHost; class RendererSettings; -class SharedBitmapManager; class SurfaceIdAllocator; class SurfaceManager; class TaskGraphRunner; @@ -58,7 +57,6 @@ class Size; namespace gpu { class GpuMemoryBufferManager; -struct Mailbox; } namespace ui { @@ -126,9 +124,6 @@ class COMPOSITOR_EXPORT ContextFactory { virtual uint32_t GetImageTextureTarget(gfx::BufferFormat format, gfx::BufferUsage usage) = 0; - // Gets the shared bitmap manager for software mode. - virtual cc::SharedBitmapManager* GetSharedBitmapManager() = 0; - // Gets the GPU memory buffer manager. virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; diff --git a/ui/compositor/test/in_process_context_factory.cc b/ui/compositor/test/in_process_context_factory.cc index 47642dd4993fdb..5458c0e399ca5a 100644 --- a/ui/compositor/test/in_process_context_factory.cc +++ b/ui/compositor/test/in_process_context_factory.cc @@ -22,7 +22,6 @@ #include "cc/surfaces/display_scheduler.h" #include "cc/surfaces/surface_id_allocator.h" #include "cc/test/pixel_test_output_surface.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "gpu/command_buffer/client/context_support.h" #include "gpu/command_buffer/client/gles2_interface.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" @@ -191,7 +190,7 @@ void InProcessContextFactory::CreateCompositorFrameSink( begin_frame_source.get(), compositor->task_runner().get(), display_output_surface->capabilities().max_frames_pending)); per_compositor_data_[compositor.get()] = base::MakeUnique( - GetSharedBitmapManager(), GetGpuMemoryBufferManager(), + &shared_bitmap_manager_, &gpu_memory_buffer_manager_, compositor->GetRendererSettings(), std::move(begin_frame_source), std::move(display_output_surface), std::move(scheduler), base::MakeUnique( @@ -200,7 +199,8 @@ void InProcessContextFactory::CreateCompositorFrameSink( auto* display = per_compositor_data_[compositor.get()].get(); auto compositor_frame_sink = base::MakeUnique( compositor->frame_sink_id(), surface_manager_, display, context_provider, - shared_worker_context_provider_); + shared_worker_context_provider_, &gpu_memory_buffer_manager_, + &shared_bitmap_manager_); compositor->SetCompositorFrameSink(std::move(compositor_frame_sink)); } @@ -245,10 +245,6 @@ uint32_t InProcessContextFactory::GetImageTextureTarget( return GL_TEXTURE_2D; } -cc::SharedBitmapManager* InProcessContextFactory::GetSharedBitmapManager() { - return &shared_bitmap_manager_; -} - gpu::GpuMemoryBufferManager* InProcessContextFactory::GetGpuMemoryBufferManager() { return &gpu_memory_buffer_manager_; diff --git a/ui/compositor/test/in_process_context_factory.h b/ui/compositor/test/in_process_context_factory.h index 4388f5f3a5f7bb..9035d470fe4dc8 100644 --- a/ui/compositor/test/in_process_context_factory.h +++ b/ui/compositor/test/in_process_context_factory.h @@ -57,7 +57,6 @@ class InProcessContextFactory : public ContextFactory { bool DoesCreateTestContexts() override; uint32_t GetImageTextureTarget(gfx::BufferFormat format, gfx::BufferUsage usage) override; - cc::SharedBitmapManager* GetSharedBitmapManager() override; gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; cc::TaskGraphRunner* GetTaskGraphRunner() override; cc::FrameSinkId AllocateFrameSinkId() override; diff --git a/ui/views/mus/surface_context_factory.cc b/ui/views/mus/surface_context_factory.cc index 626038b5b0568d..ba29f460b795b0 100644 --- a/ui/views/mus/surface_context_factory.cc +++ b/ui/views/mus/surface_context_factory.cc @@ -41,9 +41,9 @@ void SurfaceContextFactory::CreateCompositorFrameSink( ui::mojom::CompositorFrameSinkType compositor_frame_sink_type = native_widget->compositor_frame_sink_type(); auto compositor_frame_sink = window->RequestCompositorFrameSink( - compositor_frame_sink_type, - make_scoped_refptr( - new ui::ContextProvider(gpu_service_->EstablishGpuChannelSync()))); + compositor_frame_sink_type, make_scoped_refptr(new ui::ContextProvider( + gpu_service_->EstablishGpuChannelSync())), + gpu_service_->gpu_memory_buffer_manager()); compositor->SetCompositorFrameSink(std::move(compositor_frame_sink)); } @@ -78,11 +78,6 @@ uint32_t SurfaceContextFactory::GetImageTextureTarget(gfx::BufferFormat format, return GL_TEXTURE_2D; } -cc::SharedBitmapManager* SurfaceContextFactory::GetSharedBitmapManager() { - // NOTIMPLEMENTED(); - return nullptr; -} - gpu::GpuMemoryBufferManager* SurfaceContextFactory::GetGpuMemoryBufferManager() { return gpu_service_->gpu_memory_buffer_manager(); diff --git a/ui/views/mus/surface_context_factory.h b/ui/views/mus/surface_context_factory.h index d7bfe42b5e879b..8516ebb4925fa7 100644 --- a/ui/views/mus/surface_context_factory.h +++ b/ui/views/mus/surface_context_factory.h @@ -38,7 +38,6 @@ class VIEWS_MUS_EXPORT SurfaceContextFactory : public ui::ContextFactory { bool DoesCreateTestContexts() override; uint32_t GetImageTextureTarget(gfx::BufferFormat format, gfx::BufferUsage usage) override; - cc::SharedBitmapManager* GetSharedBitmapManager() override; gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; cc::TaskGraphRunner* GetTaskGraphRunner() override; cc::FrameSinkId AllocateFrameSinkId() override;