Commit 67d8bd2d authored by nduca@chromium.org's avatar nduca@chromium.org

cc: Prevent premature activation during prefer smoothness

The tile manager combines priorities from the pending and active tree for a
single tile to figure out how to prioritize it.  It does this based on the
global tree priority.  If the tile manager is in "prefer smoothness" mode, then
the active tree's priority takes precedence over the pending tree's priority.

For newly invalidated visible tiles, this means that the active tree gets an
unprioritized NEVER_BIN and the pending tree gets a NOW_BIN.  However, the
NOW_BIN would get ignored entirely, the tile manager would not have any
work for the pending tree (giving it all to prepainting the active tree),
and so LayerTreeHostImpl would activate the tree, thinking there was no
work to be done.  However, these resources are likely not rasterized yet,
and so there would be a white or low res flash before they appeared.

This patch takes the global tree priority into account.  If we are in "prefer
smoothness" mode and resources aren't ready, don't activate the tree.  This
prevents these forms of flashing during scrolling and pinching.

R=reveman@chromium.org
BUG=175276

Review URL: https://codereview.chromium.org/12211143

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182107 0039d316-1c4b-4281-b951-d872f2087c98
parent 7835b0eb
...@@ -972,11 +972,19 @@ void LayerTreeHostImpl::activatePendingTreeIfNeeded() ...@@ -972,11 +972,19 @@ void LayerTreeHostImpl::activatePendingTreeIfNeeded()
// activate once all visible resources in pending tree are ready // activate once all visible resources in pending tree are ready
// or tile manager has no work scheduled for pending tree. // or tile manager has no work scheduled for pending tree.
if (activeTree()->RootLayer() && if (activeTree()->RootLayer() &&
!pendingTree()->AreVisibleResourcesReady() && !pendingTree()->AreVisibleResourcesReady()) {
m_tileManager->HasPendingWorkScheduled(PENDING_TREE)) { // In smoothness takes priority mode, the pending tree's priorities are
TRACE_EVENT_ASYNC_STEP0("cc", // ignored, so the tile manager may not have work for it even though it
"PendingTree", m_pendingTree.get(), "waiting"); // is simultaneously not ready to be activated.
return; if (m_tileManager->GlobalState().tree_priority ==
SMOOTHNESS_TAKES_PRIORITY ||
m_tileManager->HasPendingWorkScheduled(PENDING_TREE)) {
TRACE_EVENT_ASYNC_STEP0("cc",
"PendingTree",
m_pendingTree.get(),
"waiting");
return;
}
} }
activatePendingTree(); activatePendingTree();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment