diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-05 06:18:12 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-05 06:18:12 +0000 |
commit | 614888b73113f628dc9aeaba24347ae1301faeaa (patch) | |
tree | 77c000f91e036f7256d60788863f2cf4805d8a8d /ppapi/shared_impl/ppb_graphics_3d_shared.h | |
parent | cb4282a066df8b0e1c09c90d3780625579c0a569 (diff) | |
download | chromium_src-614888b73113f628dc9aeaba24347ae1301faeaa.zip chromium_src-614888b73113f628dc9aeaba24347ae1301faeaa.tar.gz chromium_src-614888b73113f628dc9aeaba24347ae1301faeaa.tar.bz2 |
Convert ppapi/shared to use TrackedCallback.
Convert all classes in ppapi/shared_impl to use the new shared TrackedCallback
class for the PP_CompletionCallbacks.
This required a few changes to some shared objects to make them resources.
BUG=
TEST=
Review URL: http://codereview.chromium.org/9053003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/shared_impl/ppb_graphics_3d_shared.h')
-rw-r--r-- | ppapi/shared_impl/ppb_graphics_3d_shared.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.h b/ppapi/shared_impl/ppb_graphics_3d_shared.h index 6f3a04f..8804181 100644 --- a/ppapi/shared_impl/ppb_graphics_3d_shared.h +++ b/ppapi/shared_impl/ppb_graphics_3d_shared.h @@ -9,6 +9,8 @@ #include "base/memory/scoped_ptr.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/shared_impl/ppapi_shared_export.h" +#include "ppapi/shared_impl/resource.h" +#include "ppapi/shared_impl/tracked_callback.h" #include "ppapi/thunk/ppb_graphics_3d_api.h" namespace gpu { @@ -22,8 +24,12 @@ class GLES2Implementation; namespace ppapi { class PPAPI_SHARED_EXPORT PPB_Graphics3D_Shared - : public thunk::PPB_Graphics3D_API { + : public Resource, + public thunk::PPB_Graphics3D_API { public: + // Resource overrides. + virtual thunk::PPB_Graphics3D_API* AsPPB_Graphics3D_API() OVERRIDE; + // PPB_Graphics3D_API implementation. virtual int32_t GetAttribs(int32_t* attrib_list) OVERRIDE; virtual int32_t SetAttribs(int32_t* attrib_list) OVERRIDE; @@ -49,13 +55,14 @@ class PPAPI_SHARED_EXPORT PPB_Graphics3D_Shared void SwapBuffersACK(int32_t pp_error); protected: - PPB_Graphics3D_Shared(); + PPB_Graphics3D_Shared(PP_Instance instance); + PPB_Graphics3D_Shared(const HostResource& host_resource); virtual ~PPB_Graphics3D_Shared(); virtual gpu::CommandBuffer* GetCommandBuffer() = 0; virtual int32 DoSwapBuffers() = 0; - bool HasPendingSwap() { return swap_callback_.func != NULL; } + bool HasPendingSwap() const; bool CreateGLES2Impl(int32 command_buffer_size, int32 transfer_buffer_size); void DestroyGLES2Impl(); @@ -66,7 +73,7 @@ class PPAPI_SHARED_EXPORT PPB_Graphics3D_Shared scoped_ptr<gpu::gles2::GLES2Implementation> gles2_impl_; // Callback that needs to be executed when swap-buffers is completed. - PP_CompletionCallback swap_callback_; + scoped_refptr<TrackedCallback> swap_callback_; DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Shared); }; |