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

Unified Diff: cc/prioritized_texture_unittest.cc

Issue 11280268: Merge 170403 - Use a lock to deal with concurrent access to the m_evictedBackings (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src
Patch Set: Created 8 years 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 | « cc/prioritized_texture_manager.cc ('k') | cc/single_thread_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/prioritized_texture_unittest.cc
diff --git a/cc/prioritized_texture_unittest.cc b/cc/prioritized_texture_unittest.cc
index 3bf0f427181ce7488212d2d1daf124fd9194bd74..bd4e4a50d1f6a05b99aa26c79ff3fb6a0edc4518 100644
--- a/cc/prioritized_texture_unittest.cc
+++ b/cc/prioritized_texture_unittest.cc
@@ -90,6 +90,11 @@ public:
return texture->m_backing->wasAbovePriorityCutoffAtLastPriorityUpdate();
}
+ size_t evictedBackingCount(PrioritizedTextureManager* resourceManager)
+ {
+ return resourceManager->m_evictedBackings.size();
+ }
+
protected:
const IntSize m_textureSize;
const GLenum m_textureFormat;
@@ -234,17 +239,15 @@ TEST_F(PrioritizedTextureTest, changePriorityCutoff)
EXPECT_EQ(texturesMemorySize(4), textureManager->memoryAboveCutoffBytes());
// Do a one-time eviction for one more texture based on priority cutoff
- PrioritizedTextureManager::BackingList evictedBackings;
+ textureManager->unlinkAndClearEvictedBackings();
{
DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->reduceMemoryOnImplThread(texturesMemorySize(8), 104, resourceProvider());
- textureManager->getEvictedBackings(evictedBackings);
- EXPECT_EQ(0, evictedBackings.size());
+ EXPECT_EQ(0, evictedBackingCount(textureManager.get()));
textureManager->reduceMemoryOnImplThread(texturesMemorySize(8), 103, resourceProvider());
- textureManager->getEvictedBackings(evictedBackings);
- EXPECT_EQ(1, evictedBackings.size());
+ EXPECT_EQ(1, evictedBackingCount(textureManager.get()));
}
- textureManager->unlinkEvictedBackings(evictedBackings);
+ textureManager->unlinkAndClearEvictedBackings();
EXPECT_EQ(texturesMemorySize(3), textureManager->memoryUseBytes());
// Re-allocate the the texture after the one-time drop.
« no previous file with comments | « cc/prioritized_texture_manager.cc ('k') | cc/single_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698