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

Unified Diff: ppapi/native_client/src/shared/ppapi_proxy/command_buffer_nacl.cc

Issue 8865008: Revert 113479 - Revert "Revert 113250 - Add CommandBuffer::SetGetBuffer" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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
Index: ppapi/native_client/src/shared/ppapi_proxy/command_buffer_nacl.cc
===================================================================
--- ppapi/native_client/src/shared/ppapi_proxy/command_buffer_nacl.cc (revision 113511)
+++ ppapi/native_client/src/shared/ppapi_proxy/command_buffer_nacl.cc (working copy)
@@ -25,18 +25,38 @@
iface_core_->ReleaseResource(graphics_3d_);
}
-bool CommandBufferNacl::Initialize() {
+bool CommandBufferNacl::Initialize(int32 size) {
DebugPrintf("CommandBufferNacl::Initialize\n");
int32_t success;
NaClSrpcChannel* channel = ppapi_proxy::GetMainSrpcChannel();
NaClSrpcError retval =
PpbGraphics3DRpcClient::PPB_Graphics3DTrusted_InitCommandBuffer(
- channel, graphics_3d_, &success);
+ channel, graphics_3d_, size, &success);
DebugPrintf("CommandBufferNaCl::Initialize returned success=%s\n",
(PP_TRUE == success) ? "TRUE" : "FALSE");
return NACL_SRPC_RESULT_OK == retval && PP_TRUE == success;
}
+gpu::Buffer CommandBufferNacl::GetRingBuffer() {
+ DebugPrintf("CommandBufferNacl::GetRingBuffer\n");
+ if (!buffer_.ptr) {
+ DebugPrintf("CommandBufferNacl::GetRingBuffer: Fetching\n");
+ int shm_handle = -1;
+ int32_t shm_size = 0;
+
+ NaClSrpcChannel* channel = ppapi_proxy::GetMainSrpcChannel();
+ NaClSrpcError retval =
+ PpbGraphics3DRpcClient::PPB_Graphics3DTrusted_GetRingBuffer(
+ channel, graphics_3d_, &shm_handle, &shm_size);
+ if (NACL_SRPC_RESULT_OK != retval) {
+ shm_handle = -1;
+ }
+ buffer_ = BufferFromShm(shm_handle, shm_size);
+ }
+
+ return buffer_;
+}
+
gpu::CommandBuffer::State CommandBufferNacl::GetState() {
DebugPrintf("CommandBufferNacl::GetState\n");
PP_Graphics3DTrustedState state;
@@ -90,13 +110,6 @@
return last_state_;
}
-void CommandBufferNacl::SetGetBuffer(int32 transfer_buffer_id) {
- DebugPrintf("CommandBufferNacl::SetGetBuffer\n");
- NaClSrpcChannel* channel = ppapi_proxy::GetMainSrpcChannel();
- PpbGraphics3DRpcClient::PPB_Graphics3DTrusted_SetGetBuffer(
- channel, graphics_3d_, transfer_buffer_id);
-}
-
void CommandBufferNacl::SetGetOffset(int32 get_offset) {
DebugPrintf("CommandBufferNacl::SetGetOffset\n");
// Not implemented by proxy.

Powered by Google App Engine
This is Rietveld 408576698