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

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

Issue 1937173002: Revert of 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, 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_TakeFrontBuffer, OnTakeFrontBuffer); 297 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ProduceFrontBuffer,
298 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ReturnFrontBuffer, 298 OnProduceFrontBuffer);
299 OnReturnFrontBuffer);
300 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForTokenInRange, 299 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForTokenInRange,
301 OnWaitForTokenInRange); 300 OnWaitForTokenInRange);
302 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange, 301 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange,
303 OnWaitForGetOffsetInRange); 302 OnWaitForGetOffsetInRange);
304 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush); 303 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush);
305 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer, 304 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer,
306 OnRegisterTransferBuffer); 305 OnRegisterTransferBuffer);
307 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyTransferBuffer, 306 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyTransferBuffer,
308 OnDestroyTransferBuffer); 307 OnDestroyTransferBuffer);
309 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncToken, 308 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncToken,
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 } 700 }
702 701
703 void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id, 702 void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id,
704 IPC::Message* reply_message) { 703 IPC::Message* reply_message) {
705 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer"); 704 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer");
706 if (command_buffer_) 705 if (command_buffer_)
707 command_buffer_->SetGetBuffer(shm_id); 706 command_buffer_->SetGetBuffer(shm_id);
708 Send(reply_message); 707 Send(reply_message);
709 } 708 }
710 709
711 void GpuCommandBufferStub::OnTakeFrontBuffer(const Mailbox& mailbox) { 710 void GpuCommandBufferStub::OnProduceFrontBuffer(const Mailbox& mailbox) {
712 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnTakeFrontBuffer"); 711 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnProduceFrontBuffer");
713 if (!decoder_) { 712 if (!decoder_) {
714 LOG(ERROR) << "Can't take front buffer before initialization."; 713 LOG(ERROR) << "Can't produce front buffer before initialization.";
715 return; 714 return;
716 } 715 }
717 716
718 decoder_->TakeFrontBuffer(mailbox); 717 decoder_->ProduceFrontBuffer(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);
727 } 718 }
728 719
729 void GpuCommandBufferStub::OnParseError() { 720 void GpuCommandBufferStub::OnParseError() {
730 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError"); 721 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError");
731 DCHECK(command_buffer_.get()); 722 DCHECK(command_buffer_.get());
732 CommandBuffer::State state = command_buffer_->GetLastState(); 723 CommandBuffer::State state = command_buffer_->GetLastState();
733 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed( 724 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed(
734 route_id_, state.context_lost_reason, state.error); 725 route_id_, state.context_lost_reason, state.error);
735 msg->set_unblock(true); 726 msg->set_unblock(true);
736 Send(msg); 727 Send(msg);
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 result)); 1126 result));
1136 } 1127 }
1137 1128
1138 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, 1129 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase,
1139 base::TimeDelta interval) { 1130 base::TimeDelta interval) {
1140 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, 1131 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase,
1141 interval)); 1132 interval));
1142 } 1133 }
1143 1134
1144 } // namespace gpu 1135 } // 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