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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.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
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_command_buffer_stub.cc
===================================================================
--- content/common/gpu/gpu_command_buffer_stub.cc (revision 113511)
+++ content/common/gpu/gpu_command_buffer_stub.cc (working copy)
@@ -87,8 +87,6 @@
IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message)
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_Initialize,
OnInitialize);
- IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetGetBuffer,
- OnSetGetBuffer);
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetParent,
OnSetParent);
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_GetState, OnGetState);
@@ -161,6 +159,8 @@
}
void GpuCommandBufferStub::OnInitialize(
+ base::SharedMemoryHandle ring_buffer,
+ int32 size,
IPC::Message* reply_message) {
DCHECK(!command_buffer_.get());
@@ -168,7 +168,19 @@
command_buffer_.reset(new gpu::CommandBufferService);
- if (!command_buffer_->Initialize()) {
+#if defined(OS_WIN)
+ // Windows dups the shared memory handle it receives into the current process
+ // and closes it when this variable goes out of scope.
+ base::SharedMemory shared_memory(ring_buffer,
+ false,
+ channel_->renderer_process());
+#else
+ // POSIX receives a dup of the shared memory handle and closes the dup when
+ // this variable goes out of scope.
+ base::SharedMemory shared_memory(ring_buffer, false);
+#endif
+
+ if (!command_buffer_->Initialize(&shared_memory, size)) {
DLOG(ERROR) << "CommandBufferService failed to initialize.\n";
OnInitializeFailed(reply_message);
return;
@@ -250,9 +262,6 @@
command_buffer_->SetPutOffsetChangeCallback(
base::Bind(&gpu::GpuScheduler::PutChanged,
base::Unretained(scheduler_.get())));
- command_buffer_->SetGetBufferChangeCallback(
- base::Bind(&gpu::GpuScheduler::SetGetBuffer,
- base::Unretained(scheduler_.get())));
command_buffer_->SetParseErrorCallback(
base::Bind(&GpuCommandBufferStub::OnParseError, base::Unretained(this)));
scheduler_->SetScheduledCallback(
@@ -278,12 +287,6 @@
"offscreen", surface_->IsOffscreen());
}
-void GpuCommandBufferStub::OnSetGetBuffer(
- int32 shm_id, IPC::Message* reply_message) {
- command_buffer_->SetGetBuffer(shm_id);
- Send(reply_message);
-}
-
void GpuCommandBufferStub::OnSetParent(int32 parent_route_id,
uint32 parent_texture_id,
IPC::Message* reply_message) {
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698