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

Unified Diff: gpu/command_buffer/client/mapped_memory_unittest.cc

Issue 1168853002: Use mapped memory for uploading large textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Discard blocks by simply marking them as padding. Created 5 years, 6 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
Index: gpu/command_buffer/client/mapped_memory_unittest.cc
diff --git a/gpu/command_buffer/client/mapped_memory_unittest.cc b/gpu/command_buffer/client/mapped_memory_unittest.cc
index 6430b667d3f4c7683ade442d208ae246040f45bf..d118fac4973f0cff17d53e23eaa56d8bd0074b0f 100644
--- a/gpu/command_buffer/client/mapped_memory_unittest.cc
+++ b/gpu/command_buffer/client/mapped_memory_unittest.cc
@@ -324,6 +324,10 @@ TEST_F(MappedMemoryManagerTest, UnusedMemoryLimit) {
EXPECT_NE(-1, id1);
EXPECT_EQ(0u, offset1);
+ EXPECT_EQ(kChunkSize, manager_->allocated_memory());
+
+ manager_->Free(mem1);
+
// Allocate half a chunk worth of memory again.
// The same chunk will be used.
int32 id2 = -1;
@@ -335,9 +339,8 @@ TEST_F(MappedMemoryManagerTest, UnusedMemoryLimit) {
// Expect two chunks to be allocated, exceeding the limit,
// since all memory is in use.
- EXPECT_EQ(2 * kChunkSize, manager_->allocated_memory());
+ EXPECT_EQ(kChunkSize, manager_->allocated_memory());
- manager_->Free(mem1);
manager_->Free(mem2);
}
@@ -413,7 +416,7 @@ TEST_F(MappedMemoryManagerTest, Poll) {
manager_.reset(new MappedMemoryManager(
helper_.get(),
base::Bind(&Poll, this, &unmanaged_memory_list),
- kSize));
+ kSize*2));
// Allocate kSize bytes. Don't add the address to
// the unmanaged memory list, so that it won't be free:ed just yet.

Powered by Google App Engine
This is Rietveld 408576698