diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-28 21:35:10 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-28 21:35:10 +0000 |
commit | 728328e7083b060af98efb1426e4faf071db0201 (patch) | |
tree | 657a9578c4349588d986d8ce4710b5eec85c2ccb /webkit | |
parent | ce9cb76ebf7d09deeee3aed94433ea3743eb9d9b (diff) | |
download | chromium_src-728328e7083b060af98efb1426e4faf071db0201.zip chromium_src-728328e7083b060af98efb1426e4faf071db0201.tar.gz chromium_src-728328e7083b060af98efb1426e4faf071db0201.tar.bz2 |
Fix surface::swapbuffers to return correct values
BUG=none
TEST=pepper flash
Review URL: http://codereview.chromium.org/6245019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73025 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/plugins/ppapi/ppb_surface_3d_impl.cc | 14 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_surface_3d_impl.h | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc index baa03ea..e79fcd7 100644 --- a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc +++ b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc @@ -120,13 +120,19 @@ bool PPB_Surface3D_Impl::BindToContext( return true; } -bool PPB_Surface3D_Impl::SwapBuffers(PP_CompletionCallback callback) { +int32_t PPB_Surface3D_Impl::SwapBuffers(PP_CompletionCallback callback) { if (!context_) - return false; + return PP_ERROR_FAILED; if (swap_callback_.func) { // Already a pending SwapBuffers that hasn't returned yet. - return false; + return PP_ERROR_INPROGRESS; + } + + if (!callback.func) { + // Blocking SwapBuffers isn't supported (since we have to be on the main + // thread). + return PP_ERROR_BADARGUMENT; } swap_callback_ = callback; @@ -134,7 +140,7 @@ bool PPB_Surface3D_Impl::SwapBuffers(PP_CompletionCallback callback) { if (impl) { context_->gles2_impl()->SwapBuffers(); } - return true; + return PP_ERROR_WOULDBLOCK; } void PPB_Surface3D_Impl::ViewInitiatedPaint() { diff --git a/webkit/plugins/ppapi/ppb_surface_3d_impl.h b/webkit/plugins/ppapi/ppb_surface_3d_impl.h index 1576673..c0f2955 100644 --- a/webkit/plugins/ppapi/ppb_surface_3d_impl.h +++ b/webkit/plugins/ppapi/ppb_surface_3d_impl.h @@ -46,7 +46,7 @@ class PPB_Surface3D_Impl : public Resource { unsigned int GetBackingTextureId(); - bool SwapBuffers(PP_CompletionCallback callback); + int32_t SwapBuffers(PP_CompletionCallback callback); void ViewInitiatedPaint(); void ViewFlushedPaint(); |