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/compositor_impl_android.cc

Issue 2918023002: Set cc::Display visibility to false when going to the background. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fff5edb377455b6abe81f8e9a36ca5d764c3e107..5112bfed6d3148916f59a6026193d685446ebf97 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -559,12 +559,16 @@ void CompositorImpl::SetVisible(bool visible) {
if (display_.get() && HavePendingReadbacks())
display_->ForceImmediateDrawAndSwapIfPossible();
+ if (display_)
+ display_->SetVisible(false);
host_->SetVisible(false);
host_->ReleaseCompositorFrameSink();
has_compositor_frame_sink_ = false;
pending_frames_ = 0;
display_.reset();
boliu 2017/06/02 00:30:35 we reset the display a few lines below, does this
} else {
+ if (display_)
+ display_->SetVisible(true);
host_->SetVisible(true);
if (compositor_frame_sink_request_pending_)
HandlePendingCompositorFrameSinkRequest();
@@ -795,7 +799,7 @@ void CompositorImpl::InitializeDisplay(
nullptr, BrowserGpuMemoryBufferManager::current(),
viz::HostSharedBitmapManager::current());
- display_->SetVisible(true);
+ display_->SetVisible(host_->IsVisible());
display_->Resize(size_);
host_->SetCompositorFrameSink(std::move(compositor_frame_sink));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698