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

Unified Diff: cc/surfaces/surface_factory.cc

Issue 2736053004: SurfaceIds must be reusable as soon as their surfaces are marked destroyed (Closed)
Patch Set: Make deregister private Created 3 years, 9 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 | « cc/surfaces/compositor_frame_sink_support_unittest.cc ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_factory.cc
diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc
index f641274fd6063cdf385c4bdc2ae39c6068b04b43..c475793ed6fb9ed32be15b09856bf3c972f20e3c 100644
--- a/cc/surfaces/surface_factory.cc
+++ b/cc/surfaces/surface_factory.cc
@@ -150,17 +150,16 @@ void SurfaceFactory::OnSurfaceDiscarded(Surface* surface) {}
std::unique_ptr<Surface> SurfaceFactory::Create(
const LocalSurfaceId& local_surface_id) {
- auto surface = base::MakeUnique<Surface>(
- SurfaceId(frame_sink_id_, local_surface_id), weak_factory_.GetWeakPtr());
seen_first_frame_activation_ = false;
- manager_->RegisterSurface(surface.get());
+ std::unique_ptr<Surface> surface =
+ manager_->CreateSurface(weak_factory_.GetWeakPtr(), local_surface_id);
surface->AddObserver(this);
return surface;
}
void SurfaceFactory::Destroy(std::unique_ptr<Surface> surface) {
surface->RemoveObserver(this);
- manager_->Destroy(std::move(surface));
+ manager_->DestroySurface(std::move(surface));
}
} // namespace cc
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support_unittest.cc ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698