| 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;
|
| }
|
|
|