Chromium Code Reviews| Index: content/renderer/pepper/ppb_graphics_3d_impl.cc |
| diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| index 2f715b46a5309a1a76a90c9ae48241bb7eb81b3d..fc3e352ec5b10b7ca4c6a97a3b5d0eb3c5f04722 100644 |
| --- a/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| +++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| @@ -22,6 +22,7 @@ |
| #include "content/renderer/render_view_impl.h" |
| #include "gpu/command_buffer/client/gles2_implementation.h" |
| #include "ppapi/c/ppp_graphics_3d.h" |
| +#include "ppapi/shared_impl/command_buffer_id_pair.h" |
| #include "ppapi/thunk/enter.h" |
| #include "third_party/WebKit/public/platform/WebString.h" |
| #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
| @@ -80,7 +81,8 @@ PP_Resource PPB_Graphics3D_Impl::CreateRaw( |
| PP_Resource share_context, |
| const int32_t* attrib_list, |
| gpu::Capabilities* capabilities, |
| - base::SharedMemoryHandle* shared_state_handle) { |
| + base::SharedMemoryHandle* shared_state_handle, |
| + ppapi::CommandBufferIDPair* id_pair) { |
| PPB_Graphics3D_API* share_api = NULL; |
| if (share_context) { |
| EnterResourceNoLock<PPB_Graphics3D_API> enter(share_context, true); |
| @@ -91,7 +93,7 @@ PP_Resource PPB_Graphics3D_Impl::CreateRaw( |
| scoped_refptr<PPB_Graphics3D_Impl> graphics_3d( |
| new PPB_Graphics3D_Impl(instance)); |
| if (!graphics_3d->InitRaw(share_api, attrib_list, capabilities, |
| - shared_state_handle)) |
| + shared_state_handle, id_pair)) |
| return 0; |
| return graphics_3d->GetReference(); |
| } |
| @@ -205,7 +207,7 @@ int32 PPB_Graphics3D_Impl::DoSwapBuffers() { |
| bool PPB_Graphics3D_Impl::Init(PPB_Graphics3D_API* share_context, |
| const int32_t* attrib_list) { |
| - if (!InitRaw(share_context, attrib_list, NULL, NULL)) |
| + if (!InitRaw(share_context, attrib_list, NULL, NULL, NULL)) |
| return false; |
| gpu::gles2::GLES2Implementation* share_gles2 = NULL; |
| @@ -221,7 +223,8 @@ bool PPB_Graphics3D_Impl::InitRaw( |
| PPB_Graphics3D_API* share_context, |
| const int32_t* attrib_list, |
| gpu::Capabilities* capabilities, |
| - base::SharedMemoryHandle* shared_state_handle) { |
| + base::SharedMemoryHandle* shared_state_handle, |
| + ppapi::CommandBufferIDPair* id_pair) { |
| PepperPluginInstanceImpl* plugin_instance = |
| HostGlobals::Get()->GetInstance(pp_instance()); |
| if (!plugin_instance) |
| @@ -301,6 +304,10 @@ bool PPB_Graphics3D_Impl::InitRaw( |
| *shared_state_handle = command_buffer_->GetSharedStateHandle(); |
| if (capabilities) |
| *capabilities = command_buffer_->GetCapabilities(); |
| + if (id_pair) { |
| + id_pair->namespace_id = command_buffer_->GetNamespaceID(); |
|
piman
2015/09/16 21:55:13
Arguably you could hardcode the namespace on the p
bbudge
2015/09/16 22:17:18
And that would simplify the patch significantly by
David Yen
2015/09/16 22:25:28
Done.
|
| + id_pair->command_buffer_id = command_buffer_->GetCommandBufferID(); |
| + } |
| mailbox_ = gpu::Mailbox::Generate(); |
| if (!command_buffer_->ProduceFrontBuffer(mailbox_)) |
| return false; |