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

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: Created 4 years, 8 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
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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 291 }
292 292
293 // Always use IPC_MESSAGE_HANDLER_DELAY_REPLY for synchronous message handlers 293 // Always use IPC_MESSAGE_HANDLER_DELAY_REPLY for synchronous message handlers
294 // here. This is so the reply can be delayed if the scheduler is unscheduled. 294 // here. This is so the reply can be delayed if the scheduler is unscheduled.
295 bool handled = true; 295 bool handled = true;
296 IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message) 296 IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message)
297 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_Initialize, 297 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_Initialize,
298 OnInitialize); 298 OnInitialize);
299 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetGetBuffer, 299 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetGetBuffer,
300 OnSetGetBuffer); 300 OnSetGetBuffer);
301 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ProduceFrontBuffer, 301 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_TakeFrontBuffer, OnTakeFrontBuffer);
302 OnProduceFrontBuffer); 302 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ReturnFrontBuffer,
303 OnReturnFrontBuffer);
303 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForTokenInRange, 304 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForTokenInRange,
304 OnWaitForTokenInRange); 305 OnWaitForTokenInRange);
305 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange, 306 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange,
306 OnWaitForGetOffsetInRange); 307 OnWaitForGetOffsetInRange);
307 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush); 308 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush);
308 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer, 309 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer,
309 OnRegisterTransferBuffer); 310 OnRegisterTransferBuffer);
310 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyTransferBuffer, 311 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyTransferBuffer,
311 OnDestroyTransferBuffer); 312 OnDestroyTransferBuffer);
312 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncToken, 313 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncToken,
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 } 705 }
705 706
706 void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id, 707 void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id,
707 IPC::Message* reply_message) { 708 IPC::Message* reply_message) {
708 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer"); 709 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer");
709 if (command_buffer_) 710 if (command_buffer_)
710 command_buffer_->SetGetBuffer(shm_id); 711 command_buffer_->SetGetBuffer(shm_id);
711 Send(reply_message); 712 Send(reply_message);
712 } 713 }
713 714
714 void GpuCommandBufferStub::OnProduceFrontBuffer(const Mailbox& mailbox) { 715 void GpuCommandBufferStub::OnTakeFrontBuffer(const Mailbox& mailbox) {
715 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnProduceFrontBuffer"); 716 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnTakeFrontBuffer");
716 if (!decoder_) { 717 if (!decoder_) {
717 LOG(ERROR) << "Can't produce front buffer before initialization."; 718 LOG(ERROR) << "Can't take front buffer before initialization.";
718 return; 719 return;
719 } 720 }
720 721
721 decoder_->ProduceFrontBuffer(mailbox); 722 decoder_->TakeFrontBuffer(mailbox);
723 }
724
725 void GpuCommandBufferStub::OnReturnFrontBuffer(const Mailbox& mailbox,
726 const SyncToken& sync_token,
727 bool is_lost) {
728 OnWaitFenceSync(sync_token.namespace_id(), sync_token.command_buffer_id(),
729 sync_token.release_count());
730 decoder_->ReturnFrontBuffer(mailbox, is_lost);
722 } 731 }
723 732
724 void GpuCommandBufferStub::OnParseError() { 733 void GpuCommandBufferStub::OnParseError() {
725 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError"); 734 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError");
726 DCHECK(command_buffer_.get()); 735 DCHECK(command_buffer_.get());
727 CommandBuffer::State state = command_buffer_->GetLastState(); 736 CommandBuffer::State state = command_buffer_->GetLastState();
728 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed( 737 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed(
729 route_id_, state.context_lost_reason, state.error); 738 route_id_, state.context_lost_reason, state.error);
730 msg->set_unblock(true); 739 msg->set_unblock(true);
731 Send(msg); 740 Send(msg);
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 result)); 1139 result));
1131 } 1140 }
1132 1141
1133 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, 1142 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase,
1134 base::TimeDelta interval) { 1143 base::TimeDelta interval) {
1135 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, 1144 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase,
1136 interval)); 1145 interval));
1137 } 1146 }
1138 1147
1139 } // namespace gpu 1148 } // namespace gpu
OLDNEW
« gpu/command_buffer/service/gles2_cmd_decoder.cc ('K') | « gpu/ipc/service/gpu_command_buffer_stub.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698