diff options
author | dglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 20:21:44 +0000 |
---|---|---|
committer | dglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 20:21:44 +0000 |
commit | bd45bd252aeb8babac62547a5c605fbf64287cd3 (patch) | |
tree | 97cbf2f8bec035b6cf77c723a4b3b89c61338d79 /ppapi/thunk | |
parent | 32b6bae0bccbf704fbd07085e6334af7c90957f2 (diff) | |
download | chromium_src-bd45bd252aeb8babac62547a5c605fbf64287cd3.zip chromium_src-bd45bd252aeb8babac62547a5c605fbf64287cd3.tar.gz chromium_src-bd45bd252aeb8babac62547a5c605fbf64287cd3.tar.bz2 |
Revert 113250 - Add CommandBuffer::SetGetBuffer
As well as remove CommandBuffer::GetRingBuffer and
change CommandBuffer::Initialize
Before this change the service allocated and managed the command buffer.
After this change the client uses CreateTransferBuffer, GetTransferBuffer,
end potentially DeleteTransferBufffer to manage the command buffer.
Another CL will actually make the client delete the command buffer
on demand.
TEST=unit tests and run some samples and a NaCl 3D game
BUG=103989
Review URL: http://codereview.chromium.org/8566059
TBR=gman@chromium.org
Review URL: http://codereview.chromium.org/8827005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r-- | ppapi/thunk/ppb_graphics_3d_api.h | 5 | ||||
-rw-r--r-- | ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc | 12 |
2 files changed, 10 insertions, 7 deletions
diff --git a/ppapi/thunk/ppb_graphics_3d_api.h b/ppapi/thunk/ppb_graphics_3d_api.h index 4e1980a..73e8178 100644 --- a/ppapi/thunk/ppb_graphics_3d_api.h +++ b/ppapi/thunk/ppb_graphics_3d_api.h @@ -25,8 +25,9 @@ class PPAPI_THUNK_EXPORT PPB_Graphics3D_API { virtual int32_t SwapBuffers(PP_CompletionCallback callback) = 0; // Graphics3DTrusted API. - virtual PP_Bool InitCommandBuffer() = 0; - virtual PP_Bool SetGetBuffer(int32_t shm_id) = 0; + virtual PP_Bool InitCommandBuffer(int32_t size) = 0; + virtual PP_Bool GetRingBuffer(int* shm_handle, + uint32_t* shm_size) = 0; virtual PP_Graphics3DTrustedState GetState() = 0; virtual int32_t CreateTransferBuffer(uint32_t size) = 0; virtual PP_Bool DestroyTransferBuffer(int32_t id) = 0; diff --git a/ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc b/ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc index bea32ab..5cc9661 100644 --- a/ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc +++ b/ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc @@ -30,18 +30,20 @@ PP_Resource CreateRaw(PP_Instance instance, instance, share_context, attrib_list); } -PP_Bool InitCommandBuffer(PP_Resource context) { +PP_Bool InitCommandBuffer(PP_Resource context, int32_t size) { EnterGraphics3D enter(context, true); if (enter.failed()) return PP_FALSE; - return enter.object()->InitCommandBuffer(); + return enter.object()->InitCommandBuffer(size); } -PP_Bool SetGetBuffer(PP_Resource context, int32_t transfer_buffer_id) { +PP_Bool GetRingBuffer(PP_Resource context, + int* shm_handle, + uint32_t* shm_size) { EnterGraphics3D enter(context, true); if (enter.failed()) return PP_FALSE; - return enter.object()->SetGetBuffer(transfer_buffer_id); + return enter.object()->GetRingBuffer(shm_handle, shm_size); } PP_Graphics3DTrustedState GetState(PP_Resource context) { @@ -101,7 +103,7 @@ PP_Graphics3DTrustedState FlushSyncFast(PP_Resource context, const PPB_Graphics3DTrusted g_ppb_graphics_3d_trusted_thunk = { &CreateRaw, &InitCommandBuffer, - &SetGetBuffer, + &GetRingBuffer, &GetState, &CreateTransferBuffer, &DestroyTransferBuffer, |