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

Unified Diff: blimp/client/core/compositor/blimp_compositor.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
Index: blimp/client/core/compositor/blimp_compositor.cc
diff --git a/blimp/client/core/compositor/blimp_compositor.cc b/blimp/client/core/compositor/blimp_compositor.cc
index fbe2cc90230e8baba30fe4fe96e65a942028fdba..292caf7226510e771b0519e9384a99426e7f5941 100644
--- a/blimp/client/core/compositor/blimp_compositor.cc
+++ b/blimp/client/core/compositor/blimp_compositor.cc
@@ -64,6 +64,8 @@ BlimpCompositor::BlimpCompositor(
: render_widget_id_(render_widget_id),
client_(client),
compositor_dependencies_(compositor_dependencies),
+ frame_sink_id_(compositor_dependencies_->GetEmbedderDependencies()
+ ->AllocateFrameSinkId()),
proxy_client_(nullptr),
compositor_frame_sink_request_pending_(false),
layer_(cc::Layer::Create()),
@@ -72,10 +74,9 @@ BlimpCompositor::BlimpCompositor(
weak_ptr_factory_(this) {
DCHECK(thread_checker_.CalledOnValidThread());
- surface_id_allocator_ = base::MakeUnique<cc::SurfaceIdAllocator>(
- GetEmbedderDeps()->AllocateFrameSinkId());
- GetEmbedderDeps()->GetSurfaceManager()->RegisterFrameSinkId(
- surface_id_allocator_->frame_sink_id());
+ surface_id_allocator_ =
+ base::MakeUnique<cc::SurfaceIdAllocator>(frame_sink_id_);
+ GetEmbedderDeps()->GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_);
CreateLayerTreeHost();
}
@@ -83,8 +84,7 @@ BlimpCompositor::~BlimpCompositor() {
DCHECK(thread_checker_.CalledOnValidThread());
DestroyLayerTreeHost();
- GetEmbedderDeps()->GetSurfaceManager()->InvalidateFrameSinkId(
- surface_id_allocator_->frame_sink_id());
+ GetEmbedderDeps()->GetSurfaceManager()->InvalidateFrameSinkId(frame_sink_id_);
CheckPendingCommitCounts(true /* flush */);
}
@@ -211,7 +211,7 @@ void BlimpCompositor::BindToProxyClient(
proxy_client_ = proxy_client;
surface_factory_ = base::MakeUnique<cc::SurfaceFactory>(
- GetEmbedderDeps()->GetSurfaceManager(), this);
+ frame_sink_id_, GetEmbedderDeps()->GetSurfaceManager(), this);
}
void BlimpCompositor::SwapCompositorFrame(cc::CompositorFrame frame) {
« no previous file with comments | « blimp/client/core/compositor/blimp_compositor.h ('k') | blimp/client/support/compositor/blimp_embedder_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698