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

Unified Diff: ppapi/proxy/ppapi_command_buffer_proxy.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
« no previous file with comments | « ppapi/proxy/ppapi_command_buffer_proxy.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppapi_command_buffer_proxy.cc
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc
index 4d140f2a8ea912a12eb8019e88b3a39cb7d1e498..a1ac34748feeb061abeb76ee151bdebf4c0ce576 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.cc
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc
@@ -106,11 +106,6 @@ void PpapiCommandBufferProxy::SetGetBuffer(int32 transfer_buffer_id) {
}
}
-void PpapiCommandBufferProxy::SetGetOffset(int32 get_offset) {
- // Not implemented in proxy.
- NOTREACHED();
-}
-
scoped_refptr<gpu::Buffer> PpapiCommandBufferProxy::CreateTransferBuffer(
size_t size,
int32* id) {
@@ -119,66 +114,18 @@ scoped_refptr<gpu::Buffer> PpapiCommandBufferProxy::CreateTransferBuffer(
if (last_state_.error != gpu::error::kNoError)
return NULL;
- if (!Send(new PpapiHostMsg_PPBGraphics3D_CreateTransferBuffer(
- ppapi::API_ID_PPB_GRAPHICS_3D, resource_, size, id))) {
- return NULL;
- }
-
- if ((*id) <= 0)
- return NULL;
-
- return GetTransferBuffer(*id);
-}
-
-void PpapiCommandBufferProxy::DestroyTransferBuffer(int32 id) {
- if (last_state_.error != gpu::error::kNoError)
- return;
-
- // Remove the transfer buffer from the client side4 cache.
- TransferBufferMap::iterator it = transfer_buffers_.find(id);
-
- // Remove reference to buffer, allowing the shared memory object to be
- // deleted, closing the handle in the process.
- if (it != transfer_buffers_.end())
- transfer_buffers_.erase(it);
-
- Send(new PpapiHostMsg_PPBGraphics3D_DestroyTransferBuffer(
- ppapi::API_ID_PPB_GRAPHICS_3D, resource_, id));
-}
-
-void PpapiCommandBufferProxy::Echo(const base::Closure& callback) {
- NOTREACHED();
-}
-
-uint32 PpapiCommandBufferProxy::CreateStreamTexture(uint32 texture_id) {
- NOTREACHED();
- return 0;
-}
-
-scoped_refptr<gpu::Buffer> PpapiCommandBufferProxy::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.
ppapi::proxy::SerializedHandle handle(
ppapi::proxy::SerializedHandle::SHARED_MEMORY);
- if (!Send(new PpapiHostMsg_PPBGraphics3D_GetTransferBuffer(
- ppapi::API_ID_PPB_GRAPHICS_3D, resource_, id, &handle))) {
+ if (!Send(new PpapiHostMsg_PPBGraphics3D_CreateTransferBuffer(
+ ppapi::API_ID_PPB_GRAPHICS_3D, resource_, size, id, &handle))) {
return NULL;
}
- if (!handle.is_shmem())
+
+ if (*id <= 0 || !handle.is_shmem())
return NULL;
- // Cache the transfer buffer shared memory object client side.
scoped_ptr<base::SharedMemory> shared_memory(
new base::SharedMemory(handle.shmem(), false));
@@ -191,21 +138,24 @@ scoped_refptr<gpu::Buffer> PpapiCommandBufferProxy::GetTransferBuffer(
scoped_refptr<gpu::Buffer> buffer =
new gpu::Buffer(shared_memory.Pass(), handle.size());
- transfer_buffers_[id] = buffer;
return buffer;
}
-void PpapiCommandBufferProxy::SetToken(int32 token) {
- NOTREACHED();
+void PpapiCommandBufferProxy::DestroyTransferBuffer(int32 id) {
+ if (last_state_.error != gpu::error::kNoError)
+ return;
+
+ Send(new PpapiHostMsg_PPBGraphics3D_DestroyTransferBuffer(
+ ppapi::API_ID_PPB_GRAPHICS_3D, resource_, id));
}
-void PpapiCommandBufferProxy::SetParseError(gpu::error::Error error) {
+void PpapiCommandBufferProxy::Echo(const base::Closure& callback) {
NOTREACHED();
}
-void PpapiCommandBufferProxy::SetContextLostReason(
- gpu::error::ContextLostReason reason) {
+uint32 PpapiCommandBufferProxy::CreateStreamTexture(uint32 texture_id) {
NOTREACHED();
+ return 0;
}
uint32 PpapiCommandBufferProxy::InsertSyncPoint() {
« no previous file with comments | « ppapi/proxy/ppapi_command_buffer_proxy.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698