Index: cc/CCTextureUpdateQueue.cpp |
diff --git a/cc/CCTextureUpdateQueue.cpp b/cc/CCTextureUpdateQueue.cpp |
index 1619ab2c676effdf883dd11d25239bc2d27cf213..b5ebdf56b2ea2154a4822252c875e56cc5e860bd 100644 |
--- a/cc/CCTextureUpdateQueue.cpp |
+++ b/cc/CCTextureUpdateQueue.cpp |
@@ -33,10 +33,21 @@ void CCTextureUpdateQueue::appendCopy(TextureCopier::Parameters copy) |
m_copyEntries.append(copy); |
} |
-void CCTextureUpdateQueue::clearUploads() |
+void CCTextureUpdateQueue::clearUploadsToEvictedResources() |
{ |
- m_fullEntries.clear(); |
- m_partialEntries.clear(); |
+ clearUploadsToEvictedResources(m_fullEntries); |
+ clearUploadsToEvictedResources(m_partialEntries); |
+} |
+ |
+void CCTextureUpdateQueue::clearUploadsToEvictedResources(Deque<TextureUploader::Parameters>& entryQueue) |
+{ |
+ Deque<TextureUploader::Parameters> temp; |
+ entryQueue.swap(temp); |
+ while (temp.size()) { |
+ TextureUploader::Parameters upload = temp.takeFirst(); |
+ if (!upload.texture->backingResourceWasEvicted()) |
+ entryQueue.append(upload); |
+ } |
} |
TextureUploader::Parameters CCTextureUpdateQueue::takeFirstFullUpload() |