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

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

Issue 8340003: Make GLES2Implementation use a larger chunk size for mapping functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typos and formatting Created 9 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 | « gpu/command_buffer/client/mapped_memory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0b6089705ade8e154cab61ef4458f9b446a45b76..6ca8c14a7c0f9843150580d0fea7eef980384be7 100644
--- a/gpu/command_buffer/client/mapped_memory_unittest.cc
+++ b/gpu/command_buffer/client/mapped_memory_unittest.cc
@@ -273,6 +273,31 @@ TEST_F(MappedMemoryManagerTest, FreeUnused) {
EXPECT_EQ(0u, manager_->num_chunks());
}
+TEST_F(MappedMemoryManagerTest, ChunkSizeMultiple) {
+ const unsigned int kSize = 1024;
+ manager_->set_chunk_size_multiple(kSize * 2);
+ // Check if we allocate less than the chunk size multiple we get
+ // chunks arounded up.
+ int32 id1 = -1;
+ unsigned int offset1 = 0xFFFFFFFFU;
+ void* mem1 = manager_->Alloc(kSize, &id1, &offset1);
+ int32 id2 = -1;
+ unsigned int offset2 = 0xFFFFFFFFU;
+ void* mem2 = manager_->Alloc(kSize, &id2, &offset2);
+ int32 id3 = -1;
+ unsigned int offset3 = 0xFFFFFFFFU;
+ void* mem3 = manager_->Alloc(kSize, &id3, &offset3);
+ ASSERT_TRUE(mem1);
+ ASSERT_TRUE(mem2);
+ ASSERT_TRUE(mem3);
+ EXPECT_NE(-1, id1);
+ EXPECT_EQ(id1, id2);
+ EXPECT_NE(id2, id3);
+ EXPECT_EQ(0u, offset1);
+ EXPECT_EQ(kSize, offset2);
+ EXPECT_EQ(0u, offset3);
+}
+
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/client/mapped_memory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698