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

Side by Side Diff: gpu/ipc/service/gpu_command_buffer_stub.cc

Issue 1912833002: Pepper takes ownership of a mailbox before passing it to the texture layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from bbudge. Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « gpu/ipc/service/gpu_command_buffer_stub.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/ipc/service/gpu_command_buffer_stub.h" 5 #include "gpu/ipc/service/gpu_command_buffer_stub.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 287 }
288 288
289 // Always use IPC_MESSAGE_HANDLER_DELAY_REPLY for synchronous message handlers 289 // Always use IPC_MESSAGE_HANDLER_DELAY_REPLY for synchronous message handlers
290 // here. This is so the reply can be delayed if the scheduler is unscheduled. 290 // here. This is so the reply can be delayed if the scheduler is unscheduled.
291 bool handled = true; 291 bool handled = true;
292 IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message) 292 IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message)
293 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_Initialize, 293 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_Initialize,
294 OnInitialize); 294 OnInitialize);
295 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetGetBuffer, 295 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetGetBuffer,
296 OnSetGetBuffer); 296 OnSetGetBuffer);
297 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ProduceFrontBuffer, 297 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_TakeFrontBuffer, OnTakeFrontBuffer);
298 OnProduceFrontBuffer); 298 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ReturnFrontBuffer,
299 OnReturnFrontBuffer);
299 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForTokenInRange, 300 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForTokenInRange,
300 OnWaitForTokenInRange); 301 OnWaitForTokenInRange);
301 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange, 302 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange,
302 OnWaitForGetOffsetInRange); 303 OnWaitForGetOffsetInRange);
303 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush); 304 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush);
304 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer, 305 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer,
305 OnRegisterTransferBuffer); 306 OnRegisterTransferBuffer);
306 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyTransferBuffer, 307 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyTransferBuffer,
307 OnDestroyTransferBuffer); 308 OnDestroyTransferBuffer);
308 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncToken, 309 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncToken,
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 } 701 }
701 702
702 void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id, 703 void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id,
703 IPC::Message* reply_message) { 704 IPC::Message* reply_message) {
704 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer"); 705 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer");
705 if (command_buffer_) 706 if (command_buffer_)
706 command_buffer_->SetGetBuffer(shm_id); 707 command_buffer_->SetGetBuffer(shm_id);
707 Send(reply_message); 708 Send(reply_message);
708 } 709 }
709 710
710 void GpuCommandBufferStub::OnProduceFrontBuffer(const Mailbox& mailbox) { 711 void GpuCommandBufferStub::OnTakeFrontBuffer(const Mailbox& mailbox) {
711 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnProduceFrontBuffer"); 712 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnTakeFrontBuffer");
712 if (!decoder_) { 713 if (!decoder_) {
713 LOG(ERROR) << "Can't produce front buffer before initialization."; 714 LOG(ERROR) << "Can't take front buffer before initialization.";
714 return; 715 return;
715 } 716 }
716 717
717 decoder_->ProduceFrontBuffer(mailbox); 718 decoder_->TakeFrontBuffer(mailbox);
719 }
720
721 void GpuCommandBufferStub::OnReturnFrontBuffer(const Mailbox& mailbox,
722 const SyncToken& sync_token,
723 bool is_lost) {
724 OnWaitFenceSync(sync_token.namespace_id(), sync_token.command_buffer_id(),
725 sync_token.release_count());
726 decoder_->ReturnFrontBuffer(mailbox, is_lost);
718 } 727 }
719 728
720 void GpuCommandBufferStub::OnParseError() { 729 void GpuCommandBufferStub::OnParseError() {
721 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError"); 730 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError");
722 DCHECK(command_buffer_.get()); 731 DCHECK(command_buffer_.get());
723 CommandBuffer::State state = command_buffer_->GetLastState(); 732 CommandBuffer::State state = command_buffer_->GetLastState();
724 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed( 733 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed(
725 route_id_, state.context_lost_reason, state.error); 734 route_id_, state.context_lost_reason, state.error);
726 msg->set_unblock(true); 735 msg->set_unblock(true);
727 Send(msg); 736 Send(msg);
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 result)); 1135 result));
1127 } 1136 }
1128 1137
1129 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, 1138 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase,
1130 base::TimeDelta interval) { 1139 base::TimeDelta interval) {
1131 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, 1140 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase,
1132 interval)); 1141 interval));
1133 } 1142 }
1134 1143
1135 } // namespace gpu 1144 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_command_buffer_stub.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698