Index: content/browser/compositor/gpu_process_transport_factory.cc |
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc |
index 713812a1012a9e7a75bde89fbb3c362a4d9426a0..17e3b4faf461d7db95e86198b1d0aafa7f129b93 100644 |
--- a/content/browser/compositor/gpu_process_transport_factory.cc |
+++ b/content/browser/compositor/gpu_process_transport_factory.cc |
@@ -19,6 +19,7 @@ |
#include "base/threading/thread_task_runner_handle.h" |
#include "build/build_config.h" |
#include "cc/base/histograms.h" |
+#include "cc/ipc/display_compositor.mojom.h" |
#include "cc/output/texture_mailbox_deleter.h" |
#include "cc/output/vulkan_in_process_context_provider.h" |
#include "cc/raster/single_thread_task_graph_runner.h" |
@@ -28,8 +29,10 @@ |
#include "cc/surfaces/direct_compositor_frame_sink.h" |
#include "cc/surfaces/display.h" |
#include "cc/surfaces/display_scheduler.h" |
+#include "cc/surfaces/surface_info.h" |
#include "cc/surfaces/surface_manager.h" |
#include "components/display_compositor/compositor_overlay_candidate_validator.h" |
+#include "components/display_compositor/display_compositor.h" |
#include "components/display_compositor/gl_helper.h" |
#include "content/browser/compositor/browser_compositor_output_surface.h" |
#include "content/browser/compositor/gpu_browser_compositor_output_surface.h" |
@@ -175,11 +178,14 @@ struct GpuProcessTransportFactory::PerCompositorData { |
}; |
GpuProcessTransportFactory::GpuProcessTransportFactory() |
- : task_graph_runner_(new cc::SingleThreadTaskGraphRunner), |
+ : display_compositor_client_binding_(this), |
+ task_graph_runner_(new cc::SingleThreadTaskGraphRunner), |
callback_factory_(this) { |
cc::SetClientNameForMetrics("Browser"); |
- surface_manager_ = base::WrapUnique(new cc::SurfaceManager); |
+ display_compositor_ = base::MakeUnique<display_compositor::DisplayCompositor>( |
+ MakeRequest(&display_compositor_ptr_), |
+ display_compositor_client_binding_.CreateInterfacePtrAndBind()); |
task_graph_runner_->Start("CompositorTileWorker1", |
base::SimpleThread::Options()); |
@@ -588,14 +594,15 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( |
auto compositor_frame_sink = |
vulkan_context_provider |
? base::MakeUnique<cc::DirectCompositorFrameSink>( |
- compositor->frame_sink_id(), surface_manager_.get(), |
- data->display.get(), |
+ compositor->frame_sink_id(), |
+ display_compositor_->surface_manager(), data->display.get(), |
static_cast<scoped_refptr<cc::VulkanContextProvider>>( |
vulkan_context_provider)) |
: base::MakeUnique<cc::DirectCompositorFrameSink>( |
- compositor->frame_sink_id(), surface_manager_.get(), |
- data->display.get(), context_provider, |
- shared_worker_context_provider_, GetGpuMemoryBufferManager(), |
+ compositor->frame_sink_id(), |
+ display_compositor_->surface_manager(), data->display.get(), |
+ context_provider, shared_worker_context_provider_, |
+ GetGpuMemoryBufferManager(), |
HostSharedBitmapManager::current()); |
data->display->Resize(compositor->size()); |
data->display->SetOutputIsSecure(data->output_is_secure); |
@@ -783,7 +790,12 @@ void GpuProcessTransportFactory::RemoveObserver( |
} |
cc::SurfaceManager* GpuProcessTransportFactory::GetSurfaceManager() { |
- return surface_manager_.get(); |
+ return display_compositor_->surface_manager(); |
+} |
+ |
+display_compositor::DisplayCompositor* |
+GpuProcessTransportFactory::GetDisplayCompositor() { |
+ return display_compositor_.get(); |
} |
display_compositor::GLHelper* GpuProcessTransportFactory::GetGLHelper() { |
@@ -817,6 +829,11 @@ void GpuProcessTransportFactory::SetCompositorSuspendedForRecycle( |
} |
#endif |
+void GpuProcessTransportFactory::OnSurfaceCreated( |
+ const cc::SurfaceInfo& surface_info) { |
+ // TODO(fsamuel): Implement this. |
+} |
+ |
scoped_refptr<cc::ContextProvider> |
GpuProcessTransportFactory::SharedMainThreadContextProvider() { |
if (shared_main_thread_contexts_) |