Chromium Code Reviews| Index: content/renderer/pepper/ppb_graphics_3d_impl.cc |
| diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| index 18a8e90e0b63d61478acecaa2cfed2d7056d0f6a..954129be6e73d04ad92ab0dbad3b847ac6ad0572 100644 |
| --- a/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| +++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| @@ -113,9 +113,18 @@ gpu::CommandBuffer::State PPB_Graphics3D_Impl::GetState() { |
| return GetCommandBuffer()->GetState(); |
| } |
| -int32_t PPB_Graphics3D_Impl::CreateTransferBuffer(uint32_t size) { |
| +int32_t PPB_Graphics3D_Impl::CreateTransferBuffer(uint32_t size, |
| + int* shm_handle, |
| + uint32_t* shm_size) { |
| int32_t id = -1; |
| - GetCommandBuffer()->CreateTransferBuffer(size, &id); |
| + scoped_refptr<gpu::Buffer> buffer = |
| + GetCommandBuffer()->CreateTransferBuffer(size, &id); |
| + if (id < 0) |
|
no sievers
2014/03/28 21:01:03
Why not 'if (!buffer) return id'?
piman
2014/03/28 23:23:40
Either way, doesn't matter. Either buffer is set a
|
| + return id; |
| + DCHECK(buffer); |
| + PP_Bool result = ShmToHandle( |
| + buffer->shared_memory(), buffer->size(), shm_handle, shm_size); |
| + DCHECK(result); |
| return id; |
| } |
| @@ -124,14 +133,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 ShmToHandle( |
| - buffer->shared_memory(), buffer->size(), shm_handle, shm_size); |
| -} |
| - |
| PP_Bool PPB_Graphics3D_Impl::Flush(int32_t put_offset) { |
| GetCommandBuffer()->Flush(put_offset); |
| return PP_TRUE; |