Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 2688593002: WIP: Towards merging OffscreenCanvas and Mus code
Patch Set: Fix reflector unit test Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_)
« no previous file with comments | « content/browser/compositor/gpu_process_transport_factory.h ('k') | content/browser/compositor/reflector_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698