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

Unified Diff: cc/layer_tree_host_impl.cc

Issue 11734007: cc: Don't activate pending tree until all tiles are ready (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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: cc/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index ac160844b11f26821d788b6d66f719419f66fcd4..103b4ffe97dde5d3a3c1271059f116f517a6c40d 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -1008,19 +1008,14 @@ void LayerTreeHostImpl::activatePendingTreeIfNeeded()
return;
int total_pending = m_tileManager->GetTilesInBinCount(NOW_BIN, PENDING_TREE);
- int total_active = m_tileManager->GetTilesInBinCount(NOW_BIN, ACTIVE_TREE);
nduca 2013/01/05 04:51:49 The more I stare at this, the more I think we shou
int drawable_pending = m_tileManager->GetDrawableTilesInBinCount(NOW_BIN, PENDING_TREE);
- int drawable_active = m_tileManager->GetDrawableTilesInBinCount(NOW_BIN, ACTIVE_TREE);
+ int total_active = m_tileManager->GetTilesInBinCount(NOW_BIN, ACTIVE_TREE);
- if (total_pending && total_active) {
- float percent_pending = drawable_pending / static_cast<float>(total_pending);
- float percent_active = drawable_active / static_cast<float>(total_active);
- if (percent_pending < percent_active)
- return;
- }
+ // It's always fine to activate to or from an empty tree. Otherwise, only
+ // activate once all high res visible tiles are ready on the pending tree.
+ if (total_pending && total_active && total_pending != drawable_pending)
+ return;
- // If there are no pending total tiles (i.e. an empty tree), we should
- // commit immediately. Similarly, if there are no active tree tiles.
activatePendingTree();
}
« 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