| 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() {
|
|
|