diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 19:31:09 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 19:31:09 +0000 |
commit | 41f31d14541d147658b5f2c4b85a8046ab602062 (patch) | |
tree | 47dd585acc505fc4377b6469cb27ca3accf0b8bc /ppapi/thunk | |
parent | 8ebf9b135df2b2a79cf130d39a48185b8f851338 (diff) | |
download | chromium_src-41f31d14541d147658b5f2c4b85a8046ab602062.zip chromium_src-41f31d14541d147658b5f2c4b85a8046ab602062.tar.gz chromium_src-41f31d14541d147658b5f2c4b85a8046ab602062.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113250 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, 7 insertions, 10 deletions
diff --git a/ppapi/thunk/ppb_graphics_3d_api.h b/ppapi/thunk/ppb_graphics_3d_api.h index 73e8178..4e1980a 100644 --- a/ppapi/thunk/ppb_graphics_3d_api.h +++ b/ppapi/thunk/ppb_graphics_3d_api.h @@ -25,9 +25,8 @@ class PPAPI_THUNK_EXPORT PPB_Graphics3D_API { virtual int32_t SwapBuffers(PP_CompletionCallback callback) = 0; // Graphics3DTrusted API. - virtual PP_Bool InitCommandBuffer(int32_t size) = 0; - virtual PP_Bool GetRingBuffer(int* shm_handle, - uint32_t* shm_size) = 0; + virtual PP_Bool InitCommandBuffer() = 0; + virtual PP_Bool SetGetBuffer(int32_t shm_id) = 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 5cc9661..bea32ab 100644 --- a/ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc +++ b/ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc @@ -30,20 +30,18 @@ PP_Resource CreateRaw(PP_Instance instance, instance, share_context, attrib_list); } -PP_Bool InitCommandBuffer(PP_Resource context, int32_t size) { +PP_Bool InitCommandBuffer(PP_Resource context) { EnterGraphics3D enter(context, true); if (enter.failed()) return PP_FALSE; - return enter.object()->InitCommandBuffer(size); + return enter.object()->InitCommandBuffer(); } -PP_Bool GetRingBuffer(PP_Resource context, - int* shm_handle, - uint32_t* shm_size) { +PP_Bool SetGetBuffer(PP_Resource context, int32_t transfer_buffer_id) { EnterGraphics3D enter(context, true); if (enter.failed()) return PP_FALSE; - return enter.object()->GetRingBuffer(shm_handle, shm_size); + return enter.object()->SetGetBuffer(transfer_buffer_id); } PP_Graphics3DTrustedState GetState(PP_Resource context) { @@ -103,7 +101,7 @@ PP_Graphics3DTrustedState FlushSyncFast(PP_Resource context, const PPB_Graphics3DTrusted g_ppb_graphics_3d_trusted_thunk = { &CreateRaw, &InitCommandBuffer, - &GetRingBuffer, + &SetGetBuffer, &GetState, &CreateTransferBuffer, &DestroyTransferBuffer, |