diff options
Diffstat (limited to 'webkit/plugins/ppapi/ppb_context_3d_impl.cc')
-rw-r--r-- | webkit/plugins/ppapi/ppb_context_3d_impl.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/webkit/plugins/ppapi/ppb_context_3d_impl.cc b/webkit/plugins/ppapi/ppb_context_3d_impl.cc index 7d3b498..3c581c6 100644 --- a/webkit/plugins/ppapi/ppb_context_3d_impl.cc +++ b/webkit/plugins/ppapi/ppb_context_3d_impl.cc @@ -46,7 +46,8 @@ PP_Context3DTrustedState PPStateFromGPUState(gpu::CommandBuffer::State s) { s.get_offset, s.put_offset, s.token, - static_cast<PPB_Context3DTrustedError>(s.error) + static_cast<PPB_Context3DTrustedError>(s.error), + s.generation }; return state; } @@ -191,7 +192,9 @@ PP_Context3DTrustedState FlushSync(PP_Resource context_id, int32_t put_offset) { return error_state; } - return PPStateFromGPUState(context->command_buffer()->FlushSync(put_offset)); + gpu::CommandBuffer::State state = context->command_buffer()->GetState(); + return PPStateFromGPUState( + context->command_buffer()->FlushSync(put_offset, state.get_offset)); } int32_t CreateTransferBuffer(PP_Resource context_id, uint32_t size) { @@ -225,6 +228,18 @@ PP_Bool GetTransferBuffer(PP_Resource context_id, ? PP_TRUE : PP_FALSE; } +PP_Context3DTrustedState FlushSyncFast( + PP_Resource context_id, int32_t put_offset, int32 last_known_get) { + scoped_refptr<PPB_Context3D_Impl> context( + Resource::GetAs<PPB_Context3D_Impl>(context_id)); + if (!context.get() || !context->command_buffer()) { + PP_Context3DTrustedState error_state = { 0 }; + return error_state; + } + + return PPStateFromGPUState( + context->command_buffer()->FlushSync(put_offset, last_known_get)); +} } // namespace PPB_Context3D_Impl::PPB_Context3D_Impl(PluginInstance* instance) @@ -254,7 +269,8 @@ const PPB_Context3DTrusted_Dev* PPB_Context3D_Impl::GetTrustedInterface() { &FlushSync, &CreateTransferBuffer, &DestroyTransferBuffer, - &GetTransferBuffer + &GetTransferBuffer, + &FlushSyncFast, }; return &iface; } |