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

Unified Diff: cc/prioritized_texture_unittest.cc

Issue 11074009: cc: Remove LayerTextureUpdater::Texture::updateRect() callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 2 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
« no previous file with comments | « cc/layer_tree_host_unittest.cc ('k') | cc/scrollbar_layer.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 68d26f5a0a43e600ae22aa848c49162140372213..76e166b728bddb113825af31d430058a562355a5 100644
--- a/cc/prioritized_texture_unittest.cc
+++ b/cc/prioritized_texture_unittest.cc
@@ -532,5 +532,49 @@ TEST_F(CCPrioritizedTextureTest, requestLateBackingsSorting)
textureManager->clearAllMemory(resourceProvider());
}
+TEST_F(CCPrioritizedTextureTest, clearUploadsToEvictedResources)
+{
+ const size_t maxTextures = 4;
+ scoped_ptr<CCPrioritizedTextureManager> textureManager =
+ createManager(maxTextures);
+ textureManager->setMaxMemoryLimitBytes(texturesMemorySize(maxTextures));
+
+ // Create textures to fill our memory limit.
+ scoped_ptr<CCPrioritizedTexture> textures[maxTextures];
+
+ for (size_t i = 0; i < maxTextures; ++i)
+ textures[i] = textureManager->createTexture(m_textureSize, m_textureFormat);
+
+ // Set equal priorities, and allocate backings for all textures.
+ for (size_t i = 0; i < maxTextures; ++i)
+ textures[i]->setRequestPriority(100);
+ prioritizeTexturesAndBackings(textureManager.get());
+ for (unsigned i = 0; i < maxTextures; ++i)
+ EXPECT_TRUE(validateTexture(textures[i], false));
+
+ CCTextureUpdateQueue queue;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
+ for (size_t i = 0; i < maxTextures; ++i) {
+ const TextureUploader::Parameters upload = { textures[i].get() };
+ queue.appendFullUpload(upload);
+ }
+
+ // Make sure that we have backings for all of the textures.
+ for (size_t i = 0; i < maxTextures; ++i)
+ EXPECT_TRUE(textures[i]->haveBackingTexture());
+
+ queue.clearUploadsToEvictedResources();
+ EXPECT_EQ(4, queue.fullUploadSize());
+
+ textureManager->reduceMemoryOnImplThread(
+ texturesMemorySize(1), resourceProvider());
+ queue.clearUploadsToEvictedResources();
+ EXPECT_EQ(1, queue.fullUploadSize());
+
+ textureManager->reduceMemoryOnImplThread(0, resourceProvider());
+ queue.clearUploadsToEvictedResources();
+ EXPECT_EQ(0, queue.fullUploadSize());
+
+}
} // namespace
« no previous file with comments | « cc/layer_tree_host_unittest.cc ('k') | cc/scrollbar_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698