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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.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/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 69515bc512d51e6adce7b04aeeeb8c5e999d834e..52455090ad407c719873d138796bf59dda34136e 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -345,8 +345,10 @@ RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid(
locks_on_frame_count_(0),
observing_root_window_(false),
weak_ptr_factory_(this) {
- if (CompositorImpl::GetSurfaceManager())
- id_allocator_ = CompositorImpl::CreateSurfaceIdAllocator();
+ id_allocator_.reset(
+ new cc::SurfaceIdAllocator(CompositorImpl::AllocateSurfaceClientId()));
+ CompositorImpl::GetSurfaceManager()->RegisterSurfaceClientId(
+ id_allocator_->client_id());
host_->SetView(this);
SetContentViewCore(content_view_core);
}
@@ -795,6 +797,8 @@ void RenderWidgetHostViewAndroid::Destroy() {
surface_id_ = cc::SurfaceId();
}
surface_factory_.reset();
+ CompositorImpl::GetSurfaceManager()->InvalidateSurfaceClientId(
+ id_allocator_->client_id());
// The RenderWidgetHost's destruction led here, so don't call it.
host_ = NULL;

Powered by Google App Engine
This is Rietveld 408576698