}
// static
-PP_Resource PPB_Graphics3D_Impl::CreateRaw(PP_Instance instance,
- PP_Resource share_context,
- const int32_t* attrib_list) {
+PP_Resource PPB_Graphics3D_Impl::CreateRaw(
+ PP_Instance instance,
+ PP_Resource share_context,
+ const int32_t* attrib_list,
+ base::SharedMemoryHandle* shared_state_handle) {
PPB_Graphics3D_API* share_api = NULL;
if (share_context) {
EnterResourceNoLock<PPB_Graphics3D_API> enter(share_context, true);
}
scoped_refptr<PPB_Graphics3D_Impl> graphics_3d(
new PPB_Graphics3D_Impl(instance));
- if (!graphics_3d->InitRaw(share_api, attrib_list))
+ if (!graphics_3d->InitRaw(share_api, attrib_list, shared_state_handle))
return 0;
return graphics_3d->GetReference();
}
bool PPB_Graphics3D_Impl::Init(PPB_Graphics3D_API* share_context,
const int32_t* attrib_list) {
- if (!InitRaw(share_context, attrib_list))
+ if (!InitRaw(share_context, attrib_list, NULL))
return false;
gpu::gles2::GLES2Implementation* share_gles2 = NULL;
return CreateGLES2Impl(kCommandBufferSize, kTransferBufferSize, share_gles2);
}
-bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
- const int32_t* attrib_list) {
+bool PPB_Graphics3D_Impl::InitRaw(
+ PPB_Graphics3D_API* share_context,
+ const int32_t* attrib_list,
+ base::SharedMemoryHandle* shared_state_handle) {
PepperPluginInstanceImpl* plugin_instance =
HostGlobals::Get()->GetInstance(pp_instance());
if (!plugin_instance)
return false;
if (!command_buffer_->Initialize())
return false;
+ if (shared_state_handle)
+ *shared_state_handle = command_buffer_->GetSharedStateHandle();
mailbox_ = gpu::Mailbox::Generate();
if (!command_buffer_->ProduceFrontBuffer(mailbox_))
return false;