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

Unified Diff: components/exo/surface.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 | « components/exo/surface.h ('k') | content/browser/browser_plugin/browser_plugin_guest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/surface.cc
diff --git a/components/exo/surface.cc b/components/exo/surface.cc
index ca145696c7acbe613a56c270a6e2fc15df9404f0..381ba8e253ee2cde61831fb1357583ecf4dcacd6 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -194,8 +194,7 @@ void SurfaceFactoryOwner::SetBeginFrameSource(
SurfaceFactoryOwner::~SurfaceFactoryOwner() {
if (surface_factory_->manager()) {
- surface_factory_->manager()->InvalidateFrameSinkId(
- id_allocator_->frame_sink_id());
+ surface_factory_->manager()->InvalidateFrameSinkId(frame_sink_id_);
}
}
@@ -215,12 +214,13 @@ Surface::Surface()
window_->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter));
window_->set_owned_by_parent(false);
factory_owner_->surface_ = this;
- factory_owner_->id_allocator_.reset(new cc::SurfaceIdAllocator(
- aura::Env::GetInstance()->context_factory()->AllocateFrameSinkId()));
- surface_manager_->RegisterFrameSinkId(
- factory_owner_->id_allocator_->frame_sink_id());
- factory_owner_->surface_factory_.reset(
- new cc::SurfaceFactory(surface_manager_, factory_owner_.get()));
+ factory_owner_->frame_sink_id_ =
+ aura::Env::GetInstance()->context_factory()->AllocateFrameSinkId();
+ factory_owner_->id_allocator_.reset(
+ new cc::SurfaceIdAllocator(factory_owner_->frame_sink_id_));
+ surface_manager_->RegisterFrameSinkId(factory_owner_->frame_sink_id_);
+ factory_owner_->surface_factory_.reset(new cc::SurfaceFactory(
+ factory_owner_->frame_sink_id_, surface_manager_, factory_owner_.get()));
aura::Env::GetInstance()->context_factory()->AddObserver(this);
}
« no previous file with comments | « components/exo/surface.h ('k') | content/browser/browser_plugin/browser_plugin_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698