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

Unified Diff: services/ui/ws/server_window_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 | « services/ui/ws/server_window_surface.h ('k') | ui/android/delegated_frame_host_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/server_window_surface.cc
diff --git a/services/ui/ws/server_window_surface.cc b/services/ui/ws/server_window_surface.cc
index 3f2da67f0a0b7cb29e8763b3be24b627fb12a5b1..4958d0f190a1f40cd8daa28e8b0786afce7683be 100644
--- a/services/ui/ws/server_window_surface.cc
+++ b/services/ui/ws/server_window_surface.cc
@@ -21,19 +21,19 @@ ServerWindowSurface::ServerWindowSurface(
ServerWindowSurfaceManager* manager,
mojo::InterfaceRequest<Surface> request,
mojom::SurfaceClientPtr client)
- : manager_(manager),
- surface_id_allocator_(cc::FrameSinkId(manager->window()
- ->delegate()
- ->GetDisplayCompositor()
- ->GenerateNextClientId(),
- 0)),
- surface_factory_(manager_->GetSurfaceManager(), this),
+ : frame_sink_id_(manager->window()
+ ->delegate()
+ ->GetDisplayCompositor()
+ ->GenerateNextClientId(),
+ 0),
+ manager_(manager),
+ surface_id_allocator_(frame_sink_id_),
+ surface_factory_(frame_sink_id_, manager_->GetSurfaceManager(), this),
client_(std::move(client)),
binding_(this, std::move(request)) {
cc::SurfaceManager* surface_manager = manager_->GetSurfaceManager();
- surface_manager->RegisterFrameSinkId(surface_id_allocator_.frame_sink_id());
- surface_manager->RegisterSurfaceFactoryClient(
- surface_id_allocator_.frame_sink_id(), this);
+ surface_manager->RegisterFrameSinkId(frame_sink_id_);
+ surface_manager->RegisterSurfaceFactoryClient(frame_sink_id_, this);
}
ServerWindowSurface::~ServerWindowSurface() {
@@ -42,9 +42,8 @@ ServerWindowSurface::~ServerWindowSurface() {
// |surface_factory_|'s resources early on.
surface_factory_.DestroyAll();
cc::SurfaceManager* surface_manager = manager_->GetSurfaceManager();
- surface_manager->UnregisterSurfaceFactoryClient(
- surface_id_allocator_.frame_sink_id());
- surface_manager->InvalidateFrameSinkId(surface_id_allocator_.frame_sink_id());
+ surface_manager->UnregisterSurfaceFactoryClient(frame_sink_id_);
+ surface_manager->InvalidateFrameSinkId(frame_sink_id_);
}
void ServerWindowSurface::SubmitCompositorFrame(
« no previous file with comments | « services/ui/ws/server_window_surface.h ('k') | ui/android/delegated_frame_host_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698