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

Unified Diff: cc/thread_proxy.cc

Issue 11411251: Use a lock to deal with concurrent access to the m_evictedBackings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 8 years, 1 month 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/thread_proxy.cc
diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc
index 2281164263a28f51999db0dc8d1923bc5618a32b..1056fa8b49d64fa6b504c3ee95f60a412d7185eb 100644
--- a/cc/thread_proxy.cc
+++ b/cc/thread_proxy.cc
@@ -516,9 +516,6 @@ void ThreadProxy::scheduledActionBeginFrame()
beginFrameState->implTransform = m_layerTreeHostImpl->implTransform();
DCHECK_GT(m_layerTreeHostImpl->memoryAllocationLimitBytes(), 0u);
beginFrameState->memoryAllocationLimitBytes = m_layerTreeHostImpl->memoryAllocationLimitBytes();
- if (m_layerTreeHost->contentsTextureManager())
- m_layerTreeHost->contentsTextureManager()->getEvictedBackings(beginFrameState->evictedContentsTexturesBackings);
-
m_mainThreadProxy->postTask(FROM_HERE, base::Bind(&ThreadProxy::beginFrame, base::Unretained(this), base::Passed(beginFrameState.Pass())));
if (m_beginFrameCompletionEventOnImplThread) {
@@ -534,13 +531,6 @@ void ThreadProxy::beginFrame(scoped_ptr<BeginFrameAndCommitState> beginFrameStat
if (!m_layerTreeHost)
return;
- // Be sure to never early-out of unlinking evicted textures whenever, so that
- // the each evicted backing is sent to the main thread exactly once.
- if (beginFrameState && !beginFrameState->evictedContentsTexturesBackings.empty()) {
- DCHECK(m_layerTreeHost->contentsTextureManager());
- m_layerTreeHost->contentsTextureManager()->unlinkEvictedBackings(beginFrameState->evictedContentsTexturesBackings);
- }
-
if (m_deferCommits) {
m_pendingDeferredCommit = beginFrameState.Pass();
m_layerTreeHost->didDeferCommit();
@@ -595,6 +585,10 @@ void ThreadProxy::beginFrame(scoped_ptr<BeginFrameAndCommitState> beginFrameStat
return;
}
+ // Unlink any backings that the impl thread has evicted, so that we know to re-paint
+ // them in updateLayers.
+ m_layerTreeHost->contentsTextureManager()->unlinkAndClearEvictedBackings();
+
scoped_ptr<ResourceUpdateQueue> queue = make_scoped_ptr(new ResourceUpdateQueue);
m_layerTreeHost->updateLayers(*(queue.get()), beginFrameState ? beginFrameState->memoryAllocationLimitBytes : 0);

Powered by Google App Engine
This is Rietveld 408576698