From b4e2a3bbaabf98abf089396e7ce375b58fa8dfcd Mon Sep 17 00:00:00 2001 From: kenrb Date: Thu, 14 May 2015 08:05:05 -0700 Subject: Pass Surface ID namespace to renderer compositors. In order to enable renderer processes to create SurfaceSequences, they have to receive Surface ID namespaces from the browser process so that they can avoid collisions. BUG=478802 Committed: https://crrev.com/c7a5afd66499fc8442e1b3146f55b227638934d8 Cr-Commit-Position: refs/heads/master@{#329708} Review URL: https://codereview.chromium.org/1129883003 Cr-Commit-Position: refs/heads/master@{#329852} --- content/browser/renderer_host/render_widget_host_impl.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'content/browser/renderer_host/render_widget_host_impl.cc') diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 812a1d7..41245f2 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -321,6 +321,13 @@ void RenderWidgetHostImpl::SetView(RenderWidgetHostViewBase* view) { view_weak_.reset(); view_ = view; + // If the renderer has not yet been initialized, then the surface ID + // namespace will be sent during initialization. + if (view_ && renderer_initialized_) { + Send(new ViewMsg_SetSurfaceIdNamespace(routing_id_, + view_->GetSurfaceIdNamespace())); + } + GpuSurfaceTracker::Get()->SetSurfaceHandle( surface_id_, GetCompositingSurface()); @@ -415,6 +422,13 @@ void RenderWidgetHostImpl::Init() { Send(new ViewMsg_CreatingNew_ACK(routing_id_)); GetProcess()->ResumeRequestsForView(routing_id_); + // If the RWHV has not yet been set, the surface ID namespace will get + // passed down by the call to SetView(). + if (view_) { + Send(new ViewMsg_SetSurfaceIdNamespace(routing_id_, + view_->GetSurfaceIdNamespace())); + } + WasResized(); } -- cgit v1.1