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

Unified Diff: services/ui/surfaces/compositor_frame_sink.cc

Issue 2383373002: Reduce SurfaceIdAllocator usage and tie SurfaceFactory to a single FrameSinkId (Closed)
Patch Set: Rebased Created 4 years, 2 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
« no previous file with comments | « services/ui/surfaces/compositor_frame_sink.h ('k') | services/ui/ws/server_window_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/surfaces/compositor_frame_sink.cc
diff --git a/services/ui/surfaces/compositor_frame_sink.cc b/services/ui/surfaces/compositor_frame_sink.cc
index 21318a4c72cfb74b8aab728f602d7135ce358360..287e3bfdff8e420532912fbabb88e7f3e8ecab24 100644
--- a/services/ui/surfaces/compositor_frame_sink.cc
+++ b/services/ui/surfaces/compositor_frame_sink.cc
@@ -30,15 +30,14 @@ CompositorFrameSink::CompositorFrameSink(
gfx::AcceleratedWidget widget,
scoped_refptr<gpu::GpuChannelHost> gpu_channel,
const scoped_refptr<DisplayCompositor>& display_compositor)
- : task_runner_(task_runner),
+ : frame_sink_id_(display_compositor->GenerateNextClientId(), 0),
+ task_runner_(task_runner),
display_compositor_(display_compositor),
- factory_(display_compositor->manager(), this),
- allocator_(
- cc::FrameSinkId(display_compositor->GenerateNextClientId(), 0)) {
- display_compositor_->manager()->RegisterFrameSinkId(
- allocator_.frame_sink_id());
- display_compositor_->manager()->RegisterSurfaceFactoryClient(
- allocator_.frame_sink_id(), this);
+ factory_(frame_sink_id_, display_compositor->manager(), this),
+ allocator_(frame_sink_id_) {
+ display_compositor_->manager()->RegisterFrameSinkId(frame_sink_id_);
+ display_compositor_->manager()->RegisterSurfaceFactoryClient(frame_sink_id_,
+ this);
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager =
gpu_channel->gpu_memory_buffer_manager();
@@ -78,16 +77,14 @@ CompositorFrameSink::CompositorFrameSink(
cc::RendererSettings(), std::move(synthetic_begin_frame_source),
std::move(display_output_surface), std::move(scheduler),
base::MakeUnique<cc::TextureMailboxDeleter>(task_runner_.get())));
- display_->Initialize(this, display_compositor_->manager(),
- allocator_.frame_sink_id());
+ display_->Initialize(this, display_compositor_->manager(), frame_sink_id_);
display_->SetVisible(true);
}
CompositorFrameSink::~CompositorFrameSink() {
display_compositor_->manager()->UnregisterSurfaceFactoryClient(
- allocator_.frame_sink_id());
- display_compositor_->manager()->InvalidateFrameSinkId(
- allocator_.frame_sink_id());
+ frame_sink_id_);
+ display_compositor_->manager()->InvalidateFrameSinkId(frame_sink_id_);
}
void CompositorFrameSink::SubmitCompositorFrame(
« no previous file with comments | « services/ui/surfaces/compositor_frame_sink.h ('k') | services/ui/ws/server_window_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698