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

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

Issue 1964793002: Revert of [Reland 1] 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 288 }
289 289
290 // Always use IPC_MESSAGE_HANDLER_DELAY_REPLY for synchronous message handlers 290 // Always use IPC_MESSAGE_HANDLER_DELAY_REPLY for synchronous message handlers
291 // here. This is so the reply can be delayed if the scheduler is unscheduled. 291 // here. This is so the reply can be delayed if the scheduler is unscheduled.
292 bool handled = true; 292 bool handled = true;
293 IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message) 293 IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message)
294 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_Initialize, 294 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_Initialize,
295 OnInitialize); 295 OnInitialize);
296 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetGetBuffer, 296 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetGetBuffer,
297 OnSetGetBuffer); 297 OnSetGetBuffer);
298 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_TakeFrontBuffer, OnTakeFrontBuffer); 298 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ProduceFrontBuffer,
299 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ReturnFrontBuffer, 299 OnProduceFrontBuffer);
300 OnReturnFrontBuffer);
301 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForTokenInRange, 300 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForTokenInRange,
302 OnWaitForTokenInRange); 301 OnWaitForTokenInRange);
303 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange, 302 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange,
304 OnWaitForGetOffsetInRange); 303 OnWaitForGetOffsetInRange);
305 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush); 304 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush);
306 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer, 305 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer,
307 OnRegisterTransferBuffer); 306 OnRegisterTransferBuffer);
308 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyTransferBuffer, 307 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyTransferBuffer,
309 OnDestroyTransferBuffer); 308 OnDestroyTransferBuffer);
310 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_WaitSyncToken,
311 OnWaitSyncToken)
312 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncToken, 309 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncToken,
313 OnSignalSyncToken) 310 OnSignalSyncToken)
314 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalQuery, 311 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalQuery,
315 OnSignalQuery) 312 OnSignalQuery)
316 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateImage, OnCreateImage); 313 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateImage, OnCreateImage);
317 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyImage, OnDestroyImage); 314 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyImage, OnDestroyImage);
318 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateStreamTexture, 315 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateStreamTexture,
319 OnCreateStreamTexture) 316 OnCreateStreamTexture)
320 IPC_MESSAGE_UNHANDLED(handled = false) 317 IPC_MESSAGE_UNHANDLED(handled = false)
321 IPC_END_MESSAGE_MAP() 318 IPC_END_MESSAGE_MAP()
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 } 704 }
708 705
709 void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id, 706 void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id,
710 IPC::Message* reply_message) { 707 IPC::Message* reply_message) {
711 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer"); 708 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer");
712 if (command_buffer_) 709 if (command_buffer_)
713 command_buffer_->SetGetBuffer(shm_id); 710 command_buffer_->SetGetBuffer(shm_id);
714 Send(reply_message); 711 Send(reply_message);
715 } 712 }
716 713
717 void GpuCommandBufferStub::OnTakeFrontBuffer(const Mailbox& mailbox) { 714 void GpuCommandBufferStub::OnProduceFrontBuffer(const Mailbox& mailbox) {
718 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnTakeFrontBuffer"); 715 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnProduceFrontBuffer");
719 if (!decoder_) { 716 if (!decoder_) {
720 LOG(ERROR) << "Can't take front buffer before initialization."; 717 LOG(ERROR) << "Can't produce front buffer before initialization.";
721 return; 718 return;
722 } 719 }
723 720
724 decoder_->TakeFrontBuffer(mailbox); 721 decoder_->ProduceFrontBuffer(mailbox);
725 }
726
727 void GpuCommandBufferStub::OnReturnFrontBuffer(const Mailbox& mailbox,
728 bool is_lost) {
729 decoder_->ReturnFrontBuffer(mailbox, is_lost);
730 } 722 }
731 723
732 void GpuCommandBufferStub::OnParseError() { 724 void GpuCommandBufferStub::OnParseError() {
733 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError"); 725 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError");
734 DCHECK(command_buffer_.get()); 726 DCHECK(command_buffer_.get());
735 CommandBuffer::State state = command_buffer_->GetLastState(); 727 CommandBuffer::State state = command_buffer_->GetLastState();
736 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed( 728 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed(
737 route_id_, state.context_lost_reason, state.error); 729 route_id_, state.context_lost_reason, state.error);
738 msg->set_unblock(true); 730 msg->set_unblock(true);
739 Send(msg); 731 Send(msg);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 CommandBufferId command_buffer_id, 876 CommandBufferId command_buffer_id,
885 uint32_t release) { 877 uint32_t release) {
886 gles2::MailboxManager* mailbox_manager = 878 gles2::MailboxManager* mailbox_manager =
887 context_group_->mailbox_manager(); 879 context_group_->mailbox_manager();
888 if (mailbox_manager->UsesSync() && MakeCurrent()) { 880 if (mailbox_manager->UsesSync() && MakeCurrent()) {
889 SyncToken sync_token(namespace_id, 0, command_buffer_id, release); 881 SyncToken sync_token(namespace_id, 0, command_buffer_id, release);
890 mailbox_manager->PullTextureUpdates(sync_token); 882 mailbox_manager->PullTextureUpdates(sync_token);
891 } 883 }
892 } 884 }
893 885
894 void GpuCommandBufferStub::OnWaitSyncToken(const SyncToken& sync_token) {
895 OnWaitFenceSync(sync_token.namespace_id(), sync_token.command_buffer_id(),
896 sync_token.release_count());
897 }
898
899 void GpuCommandBufferStub::OnSignalSyncToken(const SyncToken& sync_token, 886 void GpuCommandBufferStub::OnSignalSyncToken(const SyncToken& sync_token,
900 uint32_t id) { 887 uint32_t id) {
901 scoped_refptr<SyncPointClientState> release_state = 888 scoped_refptr<SyncPointClientState> release_state =
902 sync_point_manager_->GetSyncPointClientState( 889 sync_point_manager_->GetSyncPointClientState(
903 sync_token.namespace_id(), sync_token.command_buffer_id()); 890 sync_token.namespace_id(), sync_token.command_buffer_id());
904 891
905 if (release_state) { 892 if (release_state) {
906 sync_point_client_->Wait(release_state.get(), sync_token.release_count(), 893 sync_point_client_->Wait(release_state.get(), sync_token.release_count(),
907 base::Bind(&GpuCommandBufferStub::OnSignalAck, 894 base::Bind(&GpuCommandBufferStub::OnSignalAck,
908 this->AsWeakPtr(), id)); 895 this->AsWeakPtr(), id));
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 result)); 1132 result));
1146 } 1133 }
1147 1134
1148 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, 1135 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase,
1149 base::TimeDelta interval) { 1136 base::TimeDelta interval) {
1150 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, 1137 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase,
1151 interval)); 1138 interval));
1152 } 1139 }
1153 1140
1154 } // namespace gpu 1141 } // 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