Index: cc/CCThreadProxy.cpp |
diff --git a/cc/CCThreadProxy.cpp b/cc/CCThreadProxy.cpp |
index 1bbe5bc929e3103f7af9cb84ceef9fcdeb207060..0bd68ec4bde6290272e726f21f38cc5115d3607d 100644 |
--- a/cc/CCThreadProxy.cpp |
+++ b/cc/CCThreadProxy.cpp |
@@ -529,7 +529,7 @@ void CCThreadProxy::beginFrame() |
} |
if (request->contentsTexturesWereDeleted) |
- m_layerTreeHost->evictAllContentTextures(); |
+ m_layerTreeHost->unlinkAllContentTextures(); |
OwnPtr<CCTextureUpdateQueue> queue = adoptPtr(new CCTextureUpdateQueue); |
m_layerTreeHost->updateLayers(*(queue.get()), request->memoryAllocationLimitBytes); |
@@ -571,7 +571,7 @@ void CCThreadProxy::beginFrameCompleteOnImplThread(CCCompletionEvent* completion |
{ |
TRACE_EVENT0("cc", "CCThreadProxy::beginFrameCompleteOnImplThread"); |
ASSERT(!m_commitCompletionEventOnImplThread); |
- ASSERT(isImplThread()); |
+ ASSERT(isImplThread() && isMainThreadBlocked()); |
ASSERT(m_schedulerOnImplThread); |
ASSERT(m_schedulerOnImplThread->commitPending()); |
@@ -581,15 +581,20 @@ void CCThreadProxy::beginFrameCompleteOnImplThread(CCCompletionEvent* completion |
return; |
} |
- if (!contentsTexturesWereDeleted && m_layerTreeHostImpl->contentsTexturesPurged()) { |
+ if (contentsTexturesWereDeleted) { |
+ ASSERT(m_layerTreeHostImpl->contentsTexturesPurged()); |
+ // We unlinked all textures on the main thread, delete them now. |
+ m_layerTreeHost->deleteUnlinkedTextures(); |
+ // Mark that we can start drawing again when this commit is complete. |
+ m_resetContentsTexturesPurgedAfterCommitOnImplThread = true; |
+ } else if (m_layerTreeHostImpl->contentsTexturesPurged()) { |
// We purged the content textures on the impl thread between the time we |
// posted the beginFrame task and now, meaning we have a bunch of |
// uploads that are now invalid. Clear the uploads (they all go to |
// content textures), and kick another commit to fill them again. |
queue->clearUploads(); |
setNeedsCommitOnImplThread(); |
- } else |
- m_resetContentsTexturesPurgedAfterCommitOnImplThread = true; |
+ } |
m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::create(CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider(), m_layerTreeHostImpl->renderer()->textureCopier(), m_layerTreeHostImpl->renderer()->textureUploader()); |
m_commitCompletionEventOnImplThread = completion; |