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

Unified Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 215803002: Remove CommandBuffer::GetTransferBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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: content/common/gpu/client/command_buffer_proxy_impl.cc
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index 8ed2802ea10c5080b984134648d8b81e29bbea3f..3cf28b67e1360904a2972329036cd2eef94f8326 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -251,11 +251,6 @@ void CommandBufferProxyImpl::SetGetBuffer(int32 shm_id) {
last_put_offset_ = -1;
}
-void CommandBufferProxyImpl::SetGetOffset(int32 get_offset) {
- // Not implemented in proxy.
- NOTREACHED();
-}
-
scoped_refptr<gpu::Buffer> CommandBufferProxyImpl::CreateTransferBuffer(
size_t size,
int32* id) {
@@ -265,7 +260,6 @@ scoped_refptr<gpu::Buffer> CommandBufferProxyImpl::CreateTransferBuffer(
return NULL;
int32 new_id = channel_->ReserveTransferBufferId();
- DCHECK(transfer_buffers_.find(new_id) == transfer_buffers_.end());
scoped_ptr<base::SharedMemory> shared_memory(
channel_->factory()->AllocateSharedMemory(size));
@@ -294,7 +288,6 @@ scoped_refptr<gpu::Buffer> CommandBufferProxyImpl::CreateTransferBuffer(
*id = new_id;
scoped_refptr<gpu::Buffer> buffer =
new gpu::Buffer(shared_memory.Pass(), size);
- transfer_buffers_[new_id] = buffer;
return buffer;
}
@@ -302,70 +295,9 @@ void CommandBufferProxyImpl::DestroyTransferBuffer(int32 id) {
if (last_state_.error != gpu::error::kNoError)
return;
- // Remove the transfer buffer from the client side cache.
- TransferBufferMap::iterator it = transfer_buffers_.find(id);
- if (it != transfer_buffers_.end())
- transfer_buffers_.erase(it);
-
Send(new GpuCommandBufferMsg_DestroyTransferBuffer(route_id_, id));
}
-scoped_refptr<gpu::Buffer> CommandBufferProxyImpl::GetTransferBuffer(int32 id) {
- if (last_state_.error != gpu::error::kNoError)
- return NULL;
-
- // Check local cache to see if there is already a client side shared memory
- // object for this id.
- TransferBufferMap::iterator it = transfer_buffers_.find(id);
- if (it != transfer_buffers_.end()) {
- return it->second;
- }
-
- // Assuming we are in the renderer process, the service is responsible for
- // duplicating the handle. This might not be true for NaCl.
- base::SharedMemoryHandle handle = base::SharedMemoryHandle();
- uint32 size;
- if (!Send(new GpuCommandBufferMsg_GetTransferBuffer(route_id_,
- id,
- &handle,
- &size))) {
- return NULL;
- }
-
- // Cache the transfer buffer shared memory object client side.
- scoped_ptr<base::SharedMemory> shared_memory(
- new base::SharedMemory(handle, false));
-
- // Map the shared memory on demand.
- if (!shared_memory->memory()) {
- if (!shared_memory->Map(size))
- return NULL;
- }
-
- scoped_refptr<gpu::Buffer> buffer =
- new gpu::Buffer(shared_memory.Pass(), size);
- transfer_buffers_[id] = buffer;
-
- return buffer;
-}
-
-void CommandBufferProxyImpl::SetToken(int32 token) {
- // Not implemented in proxy.
- NOTREACHED();
-}
-
-void CommandBufferProxyImpl::SetParseError(
- gpu::error::Error error) {
- // Not implemented in proxy.
- NOTREACHED();
-}
-
-void CommandBufferProxyImpl::SetContextLostReason(
- gpu::error::ContextLostReason reason) {
- // Not implemented in proxy.
- NOTREACHED();
-}
-
gpu::Capabilities CommandBufferProxyImpl::GetCapabilities() {
return capabilities_;
}
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698