summaryrefslogtreecommitdiffstats
path: root/cc/layer_tree_host.cc
diff options
context:
space:
mode:
authorreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-17 23:42:00 +0000
committerreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-17 23:42:00 +0000
commit6f90b9e6f0ad978c11510fa362791aa896fdde7d (patch)
tree4dfa92539bba970b5f1211bd3ec746ef641dcee8 /cc/layer_tree_host.cc
parent7522077b67bd9aa3ef0630b83d1572bdd678e88c (diff)
downloadchromium_src-6f90b9e6f0ad978c11510fa362791aa896fdde7d.zip
chromium_src-6f90b9e6f0ad978c11510fa362791aa896fdde7d.tar.gz
chromium_src-6f90b9e6f0ad978c11510fa362791aa896fdde7d.tar.bz2
cc: Fix resource eviction with impl-side painting.
When evicting resources with impl-side painting we need wait until the active tree is without evicted resources before we can draw. This moves the ContentsTexturesPurged state from LTHI to the LTI and makes LTHI::canDraw() return false when the active LTI has ContentsTexturesPurged set. The result is no change in behavior when we only have one tree, while with impl-side painting when we have two trees, canDraw() will not return true until the new tree without ContentsTexturesPurged set has been activated. BUG=170157 Review URL: https://chromiumcodereview.appspot.com/11886091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177532 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_tree_host.cc')
-rw-r--r--cc/layer_tree_host.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
index ca49b10..62f3995 100644
--- a/cc/layer_tree_host.cc
+++ b/cc/layer_tree_host.cc
@@ -254,6 +254,10 @@ void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl)
{
DCHECK(m_proxy->isImplThread());
+ // If there are linked evicted backings, these backings' resources may be put into the
+ // impl tree, so we can't draw yet. Determine this before clearing all evicted backings.
+ bool newImplTreeHasNoEvictedResources = !m_contentsTextureManager->linkedEvictedBackingsExist();
+
m_contentsTextureManager->updateBackingsInDrawingImplTree();
m_contentsTextureManager->reduceMemory(hostImpl->resourceProvider());
@@ -306,6 +310,11 @@ void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl)
hostImpl->setDebugState(m_debugState);
hostImpl->savePaintTime(m_renderingStats.totalPaintTime);
+ if (newImplTreeHasNoEvictedResources) {
+ if (syncTree->ContentsTexturesPurged())
+ syncTree->ResetContentsTexturesPurged();
+ }
+
m_commitNumber++;
}