diff options
author | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-03 03:19:35 +0000 |
---|---|---|
committer | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-03 03:19:35 +0000 |
commit | 187a88c6fc8a24487dbfd45d965627b5e586e734 (patch) | |
tree | 0f5d8e1f079f6a141d4c6224a45acc55f75a71ea /ppapi/thunk | |
parent | ade4b6d09fc4b6441cf72dbda0432cf2f93209db (diff) | |
download | chromium_src-187a88c6fc8a24487dbfd45d965627b5e586e734.zip chromium_src-187a88c6fc8a24487dbfd45d965627b5e586e734.tar.gz chromium_src-187a88c6fc8a24487dbfd45d965627b5e586e734.tar.bz2 |
Pepper 3D API changes:
1. Added GetAttribMaxValue() and GetError()
2. Fixed the documentation for SwapBuffers()
3. Replaced PP_GRAPHICS3DERROR_CONTEXT_LOST with PP_ERROR_CONTEXT_LOST
Review URL: http://codereview.chromium.org/7824040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99532 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r-- | ppapi/thunk/ppb_graphics_3d_api.h | 1 | ||||
-rw-r--r-- | ppapi/thunk/ppb_graphics_3d_thunk.cc | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/ppapi/thunk/ppb_graphics_3d_api.h b/ppapi/thunk/ppb_graphics_3d_api.h index c9af8e4..7b782254 100644 --- a/ppapi/thunk/ppb_graphics_3d_api.h +++ b/ppapi/thunk/ppb_graphics_3d_api.h @@ -20,6 +20,7 @@ class PPAPI_THUNK_EXPORT PPB_Graphics3D_API { // Graphics3D API. virtual int32_t GetAttribs(int32_t* attrib_list) = 0; virtual int32_t SetAttribs(int32_t* attrib_list) = 0; + virtual int32_t GetError() = 0; virtual int32_t ResizeBuffers(int32_t width, int32_t height) = 0; virtual int32_t SwapBuffers(PP_CompletionCallback callback) = 0; diff --git a/ppapi/thunk/ppb_graphics_3d_thunk.cc b/ppapi/thunk/ppb_graphics_3d_thunk.cc index 50c31fc..c706d33 100644 --- a/ppapi/thunk/ppb_graphics_3d_thunk.cc +++ b/ppapi/thunk/ppb_graphics_3d_thunk.cc @@ -17,6 +17,13 @@ namespace { typedef EnterResource<PPB_Graphics3D_API> EnterGraphics3D; +int32_t GetAttribMaxValue(PP_Resource instance, + int32_t attribute, + int32_t* value) { + // TODO(alokp): Implement me. + return PP_ERROR_FAILED; +} + PP_Resource Create(PP_Instance instance, PP_Resource share_context, const int32_t* attrib_list) { @@ -46,6 +53,14 @@ int32_t SetAttribs(PP_Resource graphics_3d, int32_t* attrib_list) { return enter.object()->SetAttribs(attrib_list); } +int32_t GetError(PP_Resource graphics_3d) { + EnterGraphics3D enter(graphics_3d, true); + if (enter.failed()) + return PP_ERROR_BADRESOURCE; + + return enter.object()->GetError(); +} + int32_t ResizeBuffers(PP_Resource graphics_3d, int32_t width, int32_t height) { EnterGraphics3D enter(graphics_3d, true); if (enter.failed()) @@ -62,10 +77,12 @@ int32_t SwapBuffers(PP_Resource graphics_3d, PP_CompletionCallback callback) { } const PPB_Graphics3D_Dev g_ppb_graphics_3d_thunk = { + &GetAttribMaxValue, &Create, &IsGraphics3D, &GetAttribs, &SetAttribs, + &GetError, &ResizeBuffers, &SwapBuffers }; |