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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 1239843002: cc: Call PrepareTiles when becoming visible in browser only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 5 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: cc/trees/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index b6d120b48053a54c3cfbf34b9646b6db407968f8..5637830883fd8e9766f6ac609a9e7cdd29d13e3c 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -122,7 +122,14 @@ void SingleThreadProxy::SetLayerTreeHostClientReady() {
void SingleThreadProxy::SetVisible(bool visible) {
TRACE_EVENT1("cc", "SingleThreadProxy::SetVisible", "visible", visible);
DebugScopedSetImplThread impl(this);
+
+ bool was_visible = layer_tree_host_impl_->visible();
layer_tree_host_impl_->SetVisible(visible);
+
+ // Call PrepareTiles in case we're waiting for ready to draw.
+ if (!was_visible && visible)
+ layer_tree_host_impl_->PrepareTiles();
+
if (scheduler_on_impl_thread_)
scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible());
// Changing visibility could change ShouldComposite().
« cc/trees/layer_tree_host_unittest.cc ('K') | « cc/trees/layer_tree_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698