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

Unified Diff: cc/CCLayerTreeHost.cpp

Issue 11048004: Only recycle and evict textures not in-use on the impl thread. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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 | cc/CCPrioritizedTexture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCLayerTreeHost.cpp
diff --git a/cc/CCLayerTreeHost.cpp b/cc/CCLayerTreeHost.cpp
index ceeb5368e8eb0e95e9e90685ba6b36f33e4e4a9a..8b88e3b71c41e81dbff103c1a24ad76fa624f581 100644
--- a/cc/CCLayerTreeHost.cpp
+++ b/cc/CCLayerTreeHost.cpp
@@ -245,8 +245,6 @@ void CCLayerTreeHost::beginCommitOnImplThread(CCLayerTreeHostImpl* hostImpl)
{
ASSERT(CCProxy::isImplThread());
TRACE_EVENT0("cc", "CCLayerTreeHost::commitTo");
-
- m_contentsTextureManager->reduceMemory(hostImpl->resourceProvider());
}
// This function commits the CCLayerTreeHost to an impl tree. When modifying
@@ -258,6 +256,12 @@ void CCLayerTreeHost::finishCommitOnImplThread(CCLayerTreeHostImpl* hostImpl)
{
ASSERT(CCProxy::isImplThread());
+ // We are about to synchronize trees, so it's now safe to delete textures
+ // (that may be in use on the old impl tree). Also, before pushing, update
+ // backing priorities so we know which textures to push.
+ m_contentsTextureManager->reduceMemory(hostImpl->resourceProvider());
+ m_contentsTextureManager->updateBackingsPriorities();
+
hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer(), hostImpl->detachLayerTree(), hostImpl));
if (m_rootLayer && m_hudLayer)
« no previous file with comments | « no previous file | cc/CCPrioritizedTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698