diff options
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(); |