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

Unified Diff: cc/CCSingleThreadProxy.cpp

Issue 10919320: Integrate r128344 and r128253 from WebKit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
Index: cc/CCSingleThreadProxy.cpp
diff --git a/cc/CCSingleThreadProxy.cpp b/cc/CCSingleThreadProxy.cpp
index 0a52d64ba10f336e45e03085dc9fc46dd5f0e0ca..763d668935b22f59ac12c8ecf15a7a45ef6720e1 100644
--- a/cc/CCSingleThreadProxy.cpp
+++ b/cc/CCSingleThreadProxy.cpp
@@ -255,6 +255,12 @@ void CCSingleThreadProxy::postAnimationEventsToMainThreadOnImplThread(PassOwnPtr
m_layerTreeHost->setAnimationEvents(events, wallClockTime);
}
+void CCSingleThreadProxy::releaseContentsTexturesOnImplThread()
+{
+ ASSERT(isImplThread());
+ m_layerTreeHost->reduceContentsTexturesMemoryOnImplThread(0, m_layerTreeHostImpl->resourceProvider());
+}
+
// Called by the legacy scheduling path (e.g. where render_widget does the scheduling)
void CCSingleThreadProxy::compositeImmediately()
{
@@ -280,15 +286,23 @@ bool CCSingleThreadProxy::commitAndComposite()
if (!m_layerTreeHost->initializeRendererIfNeeded())
return false;
- if (m_layerTreeHostImpl->contentsTexturesPurged()) {
- m_layerTreeHost->unlinkAllContentTextures();
+ // Unlink any texture backings that were deleted
+ CCPrioritizedTextureManager::BackingVector evictedContentsTexturesBackings;
+ {
+ DebugScopedSetImplThread implThread;
+ m_layerTreeHost->getEvictedContentTexturesBackings(evictedContentsTexturesBackings);
+ }
+ m_layerTreeHost->unlinkEvictedContentTexturesBackings(evictedContentsTexturesBackings);
+ {
DebugScopedSetImplThreadAndMainThreadBlocked implAndMainBlocked;
- m_layerTreeHost->deleteUnlinkedTextures();
+ m_layerTreeHost->deleteEvictedContentTexturesBackings();
}
CCTextureUpdateQueue queue;
m_layerTreeHost->updateLayers(queue, m_layerTreeHostImpl->memoryAllocationLimitBytes());
- m_layerTreeHostImpl->resetContentsTexturesPurged();
+
+ if (m_layerTreeHostImpl->contentsTexturesPurged())
+ m_layerTreeHostImpl->resetContentsTexturesPurged();
m_layerTreeHost->willCommit();
doCommit(queue);

Powered by Google App Engine
This is Rietveld 408576698