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

Unified Diff: content/renderer/android/synchronous_compositor_output_surface.cc

Issue 2166423002: ui::ContextFactory should not create SurfaceIdAllocators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dana's nit Created 4 years, 5 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: content/renderer/android/synchronous_compositor_output_surface.cc
diff --git a/content/renderer/android/synchronous_compositor_output_surface.cc b/content/renderer/android/synchronous_compositor_output_surface.cc
index a186f41fe1842dedff11e8ea81491acb48c1aa87..87b543ba7fe1d7df8a40dd1e5e827e9db1586771 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.cc
+++ b/content/renderer/android/synchronous_compositor_output_surface.cc
@@ -106,10 +106,10 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
capabilities_.delegated_rendering = true;
memory_policy_.priority_cutoff_when_visible =
gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE;
- surface_id_allocator_->RegisterSurfaceClientId(surface_manager_.get());
}
-SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {}
+SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() =
+ default;
void SynchronousCompositorOutputSurface::SetSyncClient(
SynchronousCompositorOutputSurfaceClient* compositor) {
@@ -143,6 +143,7 @@ bool SynchronousCompositorOutputSurface::BindToClient(
registry_->RegisterOutputSurface(routing_id_, this);
registered_ = true;
+ surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id());
surface_manager_->RegisterSurfaceFactoryClient(
surface_id_allocator_->client_id(), this);
@@ -174,6 +175,8 @@ void SynchronousCompositorOutputSurface::DetachFromClient() {
surface_factory_->Destroy(delegated_surface_id_);
surface_manager_->UnregisterSurfaceFactoryClient(
surface_id_allocator_->client_id());
+ surface_manager_->InvalidateSurfaceClientId(
+ surface_id_allocator_->client_id());
display_ = nullptr;
surface_factory_ = nullptr;
surface_id_allocator_ = nullptr;
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | content/test/test_render_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698