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/service/transfer_buffer_manager.cc

Issue 213353005: Refactor gpu::Buffer to allow different types of backing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix pointer alignment in tests 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
Index: gpu/command_buffer/service/transfer_buffer_manager.cc
diff --git a/gpu/command_buffer/service/transfer_buffer_manager.cc b/gpu/command_buffer/service/transfer_buffer_manager.cc
index 7f81115b85b5c653c936fef28156e86bd06d54b5..4404a9eb6c48cd781bfc233922a06f79c25073a4 100644
--- a/gpu/command_buffer/service/transfer_buffer_manager.cc
+++ b/gpu/command_buffer/service/transfer_buffer_manager.cc
@@ -40,8 +40,7 @@ bool TransferBufferManager::Initialize() {
bool TransferBufferManager::RegisterTransferBuffer(
int32 id,
- scoped_ptr<base::SharedMemory> shared_memory,
- size_t size) {
+ scoped_ptr<BufferBacking> buffer_backing) {
if (id <= 0) {
DVLOG(0) << "Cannot register transfer buffer with non-positive ID.";
return false;
@@ -54,13 +53,13 @@ bool TransferBufferManager::RegisterTransferBuffer(
}
// Register the shared memory with the ID.
- scoped_refptr<Buffer> buffer = new gpu::Buffer(shared_memory.Pass(), size);
+ scoped_refptr<Buffer> buffer(new gpu::Buffer(buffer_backing.Pass()));
// Check buffer alignment is sane.
DCHECK(!(reinterpret_cast<uintptr_t>(buffer->memory()) &
(kCommandBufferEntrySize - 1)));
- shared_memory_bytes_allocated_ += size;
+ shared_memory_bytes_allocated_ += buffer->size();
TRACE_COUNTER_ID1(
"gpu", "GpuTransferBufferMemory", this, shared_memory_bytes_allocated_);
« no previous file with comments | « gpu/command_buffer/service/transfer_buffer_manager.h ('k') | gpu/command_buffer/service/transfer_buffer_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698