diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-01 09:06:43 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-01 09:06:43 +0000 |
commit | 046fa1ac81455233e53b629f2160ca9eab08e741 (patch) | |
tree | b9376b2320f2fd801a71580f9325bf31ee950359 /content/renderer/pepper/ppb_graphics_3d_impl.cc | |
parent | 966a3c6eda39c487da641e1b5e4ccba06802e3ba (diff) | |
download | chromium_src-046fa1ac81455233e53b629f2160ca9eab08e741.zip chromium_src-046fa1ac81455233e53b629f2160ca9eab08e741.tar.gz chromium_src-046fa1ac81455233e53b629f2160ca9eab08e741.tar.bz2 |
Remove CommandBuffer::GetTransferBuffer.
The only time we call GetTransferBuffer is on Pepper, right after
CreateTransferBuffer, so combine the two. This lets us dramatically remove all
the maintenance burden (maps) and extra IPCs.
Also separate service-only calls out of CommandBuffer, into CommandBufferServiceBase
BUG=None
Review URL: https://codereview.chromium.org/215803002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/pepper/ppb_graphics_3d_impl.cc')
-rw-r--r-- | content/renderer/pepper/ppb_graphics_3d_impl.cc | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc index 1ba14bc..3ad09d4 100644 --- a/content/renderer/pepper/ppb_graphics_3d_impl.cc +++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc @@ -38,22 +38,6 @@ namespace { const int32 kCommandBufferSize = 1024 * 1024; const int32 kTransferBufferSize = 1024 * 1024; -PP_Bool BufferToHandle(scoped_refptr<gpu::Buffer> buffer, - int* shm_handle, - uint32_t* shm_size) { - if (!buffer || !shm_handle || !shm_size) - return PP_FALSE; -#if defined(OS_POSIX) - *shm_handle = buffer->shared_memory()->handle().fd; -#elif defined(OS_WIN) - *shm_handle = reinterpret_cast<int>(buffer->shared_memory()->handle()); -#else - #error "Platform not supported." -#endif - *shm_size = buffer->size(); - return PP_TRUE; -} - } // namespace. PPB_Graphics3D_Impl::PPB_Graphics3D_Impl(PP_Instance instance) @@ -112,10 +96,10 @@ gpu::CommandBuffer::State PPB_Graphics3D_Impl::GetState() { return GetCommandBuffer()->GetState(); } -int32_t PPB_Graphics3D_Impl::CreateTransferBuffer(uint32_t size) { - int32_t id = -1; - GetCommandBuffer()->CreateTransferBuffer(size, &id); - return id; +scoped_refptr<gpu::Buffer> PPB_Graphics3D_Impl::CreateTransferBuffer( + uint32_t size, + int32_t* id) { + return GetCommandBuffer()->CreateTransferBuffer(size, id); } PP_Bool PPB_Graphics3D_Impl::DestroyTransferBuffer(int32_t id) { @@ -123,13 +107,6 @@ PP_Bool PPB_Graphics3D_Impl::DestroyTransferBuffer(int32_t id) { return PP_TRUE; } -PP_Bool PPB_Graphics3D_Impl::GetTransferBuffer(int32_t id, - int* shm_handle, - uint32_t* shm_size) { - scoped_refptr<gpu::Buffer> buffer = GetCommandBuffer()->GetTransferBuffer(id); - return BufferToHandle(buffer, shm_handle, shm_size); -} - PP_Bool PPB_Graphics3D_Impl::Flush(int32_t put_offset) { GetCommandBuffer()->Flush(put_offset); return PP_TRUE; |