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

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

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Unset texture and texture_ref after deleting Created 6 years, 9 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 aeab0801aa3ea6b0c93d5856d1aadc062d13db67..b62ca27e4bf7a103b7527e1bb16cc16a01faf7c1 100644
--- a/gpu/command_buffer/client/mapped_memory.cc
+++ b/gpu/command_buffer/client/mapped_memory.cc
@@ -15,17 +15,20 @@ namespace gpu {
MemoryChunk::MemoryChunk(int32 shm_id,
scoped_refptr<gpu::Buffer> shm,
- CommandBufferHelper* helper)
+ CommandBufferHelper* helper,
+ const base::Closure& poll_callback)
: shm_id_(shm_id),
shm_(shm),
- allocator_(shm->size(), helper, shm->memory()) {}
+ allocator_(shm->size(), helper, poll_callback, shm->memory()) {}
MemoryChunk::~MemoryChunk() {}
MappedMemoryManager::MappedMemoryManager(CommandBufferHelper* helper,
+ const base::Closure& poll_callback,
size_t unused_memory_reclaim_limit)
: chunk_size_multiple_(1),
helper_(helper),
+ poll_callback_(poll_callback),
allocated_memory_(0),
max_free_bytes_(unused_memory_reclaim_limit) {
}
@@ -88,7 +91,7 @@ void* MappedMemoryManager::Alloc(
cmd_buf->CreateTransferBuffer(chunk_size, &id);
if (id < 0)
return NULL;
- MemoryChunk* mc = new MemoryChunk(id, shm, helper_);
+ MemoryChunk* mc = new MemoryChunk(id, shm, helper_, poll_callback_);
allocated_memory_ += mc->GetSize();
chunks_.push_back(mc);
void* mem = mc->Alloc(size);
« 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