Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2277)

Unified Diff: content/renderer/pepper/ppb_graphics_3d_impl.cc

Issue 1345813002: Added a unique command buffer ID for command buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/pepper/ppb_graphics_3d_impl.h ('k') | content/renderer/pepper/resource_creation_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « content/renderer/pepper/ppb_graphics_3d_impl.h ('k') | content/renderer/pepper/resource_creation_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698