diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-06 05:08:17 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-06 05:08:17 +0000 |
commit | 235c7b4cda7a94c4834593d3242da5ff34650242 (patch) | |
tree | 4aadd53f6037eed1d054d727a8a49beb82bf09aa /cc | |
parent | d936f9089ac76c693102352328d75fa8d88acefc (diff) | |
download | chromium_src-235c7b4cda7a94c4834593d3242da5ff34650242.zip chromium_src-235c7b4cda7a94c4834593d3242da5ff34650242.tar.gz chromium_src-235c7b4cda7a94c4834593d3242da5ff34650242.tar.bz2 |
cc: Don't activate pending tree until all tiles are ready
Previously, we'd activate the pending tree if there were similar numbers of
checkerboards, but this could cause unfortunate flashing. Now, only activate
the tree if all the tiles in the 'now' bin (high-res, visible) are ready.
NOTRY=true
R=nduca@chromium.org
BUG=155209
Review URL: https://chromiumcodereview.appspot.com/11734007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175295 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/layer_tree_host_impl.cc | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc index 6c77134..456fa01 100644 --- a/cc/layer_tree_host_impl.cc +++ b/cc/layer_tree_host_impl.cc @@ -1011,19 +1011,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); 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(); } |