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

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

Issue 2012303002: [Merge to 2743] Revert "[Reland 2] Pepper takes ownership of a mailbox before passing it to the tex… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 return false; 225 return false;
226 have_context = true; 226 have_context = true;
227 } 227 }
228 228
229 // Always use IPC_MESSAGE_HANDLER_DELAY_REPLY for synchronous message handlers 229 // Always use IPC_MESSAGE_HANDLER_DELAY_REPLY for synchronous message handlers
230 // here. This is so the reply can be delayed if the scheduler is unscheduled. 230 // here. This is so the reply can be delayed if the scheduler is unscheduled.
231 bool handled = true; 231 bool handled = true;
232 IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message) 232 IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message)
233 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetGetBuffer, 233 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_SetGetBuffer,
234 OnSetGetBuffer); 234 OnSetGetBuffer);
235 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_TakeFrontBuffer, OnTakeFrontBuffer); 235 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ProduceFrontBuffer,
236 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ReturnFrontBuffer, 236 OnProduceFrontBuffer);
237 OnReturnFrontBuffer);
238 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForTokenInRange, 237 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForTokenInRange,
239 OnWaitForTokenInRange); 238 OnWaitForTokenInRange);
240 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange, 239 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange,
241 OnWaitForGetOffsetInRange); 240 OnWaitForGetOffsetInRange);
242 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush); 241 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush);
243 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer, 242 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer,
244 OnRegisterTransferBuffer); 243 OnRegisterTransferBuffer);
245 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyTransferBuffer, 244 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyTransferBuffer,
246 OnDestroyTransferBuffer); 245 OnDestroyTransferBuffer);
247 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_WaitSyncToken,
248 OnWaitSyncToken)
249 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncToken, 246 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncToken,
250 OnSignalSyncToken) 247 OnSignalSyncToken)
251 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalQuery, 248 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalQuery,
252 OnSignalQuery) 249 OnSignalQuery)
253 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateImage, OnCreateImage); 250 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateImage, OnCreateImage);
254 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyImage, OnDestroyImage); 251 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyImage, OnDestroyImage);
255 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateStreamTexture, 252 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateStreamTexture,
256 OnCreateStreamTexture) 253 OnCreateStreamTexture)
257 IPC_MESSAGE_UNHANDLED(handled = false) 254 IPC_MESSAGE_UNHANDLED(handled = false)
258 IPC_END_MESSAGE_MAP() 255 IPC_END_MESSAGE_MAP()
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 } 651 }
655 652
656 void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id, 653 void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id,
657 IPC::Message* reply_message) { 654 IPC::Message* reply_message) {
658 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer"); 655 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer");
659 if (command_buffer_) 656 if (command_buffer_)
660 command_buffer_->SetGetBuffer(shm_id); 657 command_buffer_->SetGetBuffer(shm_id);
661 Send(reply_message); 658 Send(reply_message);
662 } 659 }
663 660
664 void GpuCommandBufferStub::OnTakeFrontBuffer(const Mailbox& mailbox) { 661 void GpuCommandBufferStub::OnProduceFrontBuffer(const Mailbox& mailbox) {
665 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnTakeFrontBuffer"); 662 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnProduceFrontBuffer");
666 if (!decoder_) { 663 if (!decoder_) {
667 LOG(ERROR) << "Can't take front buffer before initialization."; 664 LOG(ERROR) << "Can't produce front buffer before initialization.";
668 return; 665 return;
669 } 666 }
670 667
671 decoder_->TakeFrontBuffer(mailbox); 668 decoder_->ProduceFrontBuffer(mailbox);
672 }
673
674 void GpuCommandBufferStub::OnReturnFrontBuffer(const Mailbox& mailbox,
675 bool is_lost) {
676 decoder_->ReturnFrontBuffer(mailbox, is_lost);
677 } 669 }
678 670
679 void GpuCommandBufferStub::OnParseError() { 671 void GpuCommandBufferStub::OnParseError() {
680 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError"); 672 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError");
681 DCHECK(command_buffer_.get()); 673 DCHECK(command_buffer_.get());
682 CommandBuffer::State state = command_buffer_->GetLastState(); 674 CommandBuffer::State state = command_buffer_->GetLastState();
683 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed( 675 IPC::Message* msg = new GpuCommandBufferMsg_Destroyed(
684 route_id_, state.context_lost_reason, state.error); 676 route_id_, state.context_lost_reason, state.error);
685 msg->set_unblock(true); 677 msg->set_unblock(true);
686 Send(msg); 678 Send(msg);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 CommandBufferId command_buffer_id, 823 CommandBufferId command_buffer_id,
832 uint32_t release) { 824 uint32_t release) {
833 gles2::MailboxManager* mailbox_manager = 825 gles2::MailboxManager* mailbox_manager =
834 context_group_->mailbox_manager(); 826 context_group_->mailbox_manager();
835 if (mailbox_manager->UsesSync() && MakeCurrent()) { 827 if (mailbox_manager->UsesSync() && MakeCurrent()) {
836 SyncToken sync_token(namespace_id, 0, command_buffer_id, release); 828 SyncToken sync_token(namespace_id, 0, command_buffer_id, release);
837 mailbox_manager->PullTextureUpdates(sync_token); 829 mailbox_manager->PullTextureUpdates(sync_token);
838 } 830 }
839 } 831 }
840 832
841 void GpuCommandBufferStub::OnWaitSyncToken(const SyncToken& sync_token) {
842 OnWaitFenceSync(sync_token.namespace_id(), sync_token.command_buffer_id(),
843 sync_token.release_count());
844 }
845
846 void GpuCommandBufferStub::OnSignalSyncToken(const SyncToken& sync_token, 833 void GpuCommandBufferStub::OnSignalSyncToken(const SyncToken& sync_token,
847 uint32_t id) { 834 uint32_t id) {
848 scoped_refptr<SyncPointClientState> release_state = 835 scoped_refptr<SyncPointClientState> release_state =
849 channel_->sync_point_manager()->GetSyncPointClientState( 836 channel_->sync_point_manager()->GetSyncPointClientState(
850 sync_token.namespace_id(), sync_token.command_buffer_id()); 837 sync_token.namespace_id(), sync_token.command_buffer_id());
851 838
852 if (release_state) { 839 if (release_state) {
853 sync_point_client_->Wait(release_state.get(), sync_token.release_count(), 840 sync_point_client_->Wait(release_state.get(), sync_token.release_count(),
854 base::Bind(&GpuCommandBufferStub::OnSignalAck, 841 base::Bind(&GpuCommandBufferStub::OnSignalAck,
855 this->AsWeakPtr(), id)); 842 this->AsWeakPtr(), id));
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params)); 1077 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params));
1091 } 1078 }
1092 1079
1093 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, 1080 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase,
1094 base::TimeDelta interval) { 1081 base::TimeDelta interval) {
1095 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, 1082 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase,
1096 interval)); 1083 interval));
1097 } 1084 }
1098 1085
1099 } // namespace gpu 1086 } // 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