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

Unified Diff: gpu/command_buffer/client/mapped_memory.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.h ('k') | gpu/command_buffer/client/mapped_memory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/mapped_memory.cc
diff --git a/gpu/command_buffer/client/mapped_memory.cc b/gpu/command_buffer/client/mapped_memory.cc
index 461343e25a0f8a012c64be04ea0f4877fbf8feba..c8d400ec25dc8be835ea8f68c654a923cf6017dd 100644
--- a/gpu/command_buffer/client/mapped_memory.cc
+++ b/gpu/command_buffer/client/mapped_memory.cc
@@ -23,7 +23,8 @@ MemoryChunk::MemoryChunk(
}
MappedMemoryManager::MappedMemoryManager(CommandBufferHelper* helper)
- : helper_(helper) {
+ : chunk_size_multiple_(1),
+ helper_(helper) {
}
MappedMemoryManager::~MappedMemoryManager() {
@@ -52,7 +53,10 @@ void* MappedMemoryManager::Alloc(
// Make a new chunk to satisfy the request.
CommandBuffer* cmd_buf = helper_->command_buffer();
- int32 id = cmd_buf->CreateTransferBuffer(size, -1);
+ unsigned int chunk_size =
+ ((size + chunk_size_multiple_ - 1) / chunk_size_multiple_) *
+ chunk_size_multiple_;
+ int32 id = cmd_buf->CreateTransferBuffer(chunk_size, -1);
if (id == -1) {
return NULL;
}
« no previous file with comments | « gpu/command_buffer/client/mapped_memory.h ('k') | gpu/command_buffer/client/mapped_memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698