Chromium Code Reviews| Index: content/browser/renderer_host/compositor_impl_android.cc |
| diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc |
| index 752f72344cfa462ec18928f2ab52ce6e54a1641c..9f392c1765e31de725c44d7df700a3b4224f63cf 100644 |
| --- a/content/browser/renderer_host/compositor_impl_android.cc |
| +++ b/content/browser/renderer_host/compositor_impl_android.cc |
| @@ -671,7 +671,11 @@ void CompositorImpl::InitializeDisplay( |
| frame_sink_id_, manager, display_.get(), context_provider, |
| nullptr, BrowserGpuMemoryBufferManager::current(), |
| HostSharedBitmapManager::current()); |
| - |
| + for (auto& frame_sink_id : pending_child_frame_sink_ids_) { |
|
Fady Samuel
2017/01/25 22:36:51
This should probably go in DidInitializeCompositor
Alex Z.
2017/01/26 01:33:56
Done.
|
| + AddChildFrameSink(frame_sink_id); |
| + } |
| + pending_child_frame_sink_ids_.clear(); |
| + has_compositor_frame_sink_ = true; |
|
Fady Samuel
2017/01/25 22:36:51
I don't think this is necessary.
Alex Z.
2017/01/26 01:33:56
We need the flag to change when DirectCompositorFr
|
| display_->SetVisible(true); |
| display_->Resize(size_); |
| host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); |
| @@ -706,6 +710,7 @@ void CompositorImpl::DidReceiveCompositorFrameAck() { |
| void CompositorImpl::DidLoseCompositorFrameSink() { |
| TRACE_EVENT0("compositor", "CompositorImpl::DidLoseCompositorFrameSink"); |
| + has_compositor_frame_sink_ = false; |
| client_->OnSwapBuffersCompleted(0); |
| } |
| @@ -735,6 +740,19 @@ cc::FrameSinkId CompositorImpl::GetFrameSinkId() { |
| return frame_sink_id_; |
| } |
| +void CompositorImpl::AddChildFrameSink(cc::FrameSinkId frame_sink_id) { |
| + if (!has_compositor_frame_sink_) { |
|
Fady Samuel
2017/01/25 22:36:51
if (compositor_frame_sink_request_pending_)
Alex Z.
2017/01/26 01:33:56
compositor_frame_sink_request_pending_ gets flippe
|
| + pending_child_frame_sink_ids_.insert(frame_sink_id); |
| + } else { |
| + // All pending child frame sink ids should be added upon the creation of |
| + // compositor frame sink. |
| + DCHECK(pending_child_frame_sink_ids_.empty()); |
| + ui::ContextProviderFactory::GetInstance() |
| + ->GetSurfaceManager() |
| + ->RegisterFrameSinkHierarchy(frame_sink_id_, frame_sink_id); |
| + } |
| +} |
| + |
| bool CompositorImpl::HavePendingReadbacks() { |
| return !readback_layer_tree_->children().empty(); |
| } |