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

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

Issue 2021603002: gpu: Add a new extension CHROMIUM_deschedule. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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') | no next file » | 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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 decoder_->GetLogger()->SetMsgCallback( 603 decoder_->GetLogger()->SetMsgCallback(
604 base::Bind(&GpuCommandBufferStub::SendConsoleMessage, 604 base::Bind(&GpuCommandBufferStub::SendConsoleMessage,
605 base::Unretained(this))); 605 base::Unretained(this)));
606 decoder_->SetShaderCacheCallback( 606 decoder_->SetShaderCacheCallback(
607 base::Bind(&GpuCommandBufferStub::SendCachedShader, 607 base::Bind(&GpuCommandBufferStub::SendCachedShader,
608 base::Unretained(this))); 608 base::Unretained(this)));
609 decoder_->SetFenceSyncReleaseCallback(base::Bind( 609 decoder_->SetFenceSyncReleaseCallback(base::Bind(
610 &GpuCommandBufferStub::OnFenceSyncRelease, base::Unretained(this))); 610 &GpuCommandBufferStub::OnFenceSyncRelease, base::Unretained(this)));
611 decoder_->SetWaitFenceSyncCallback(base::Bind( 611 decoder_->SetWaitFenceSyncCallback(base::Bind(
612 &GpuCommandBufferStub::OnWaitFenceSync, base::Unretained(this))); 612 &GpuCommandBufferStub::OnWaitFenceSync, base::Unretained(this)));
613 decoder_->SetDescheduleUntilFinishedCallback(
614 base::Bind(&GpuCommandBufferStub::OnDescheduleUntilFinished,
615 base::Unretained(this)));
616 decoder_->SetRescheduleAfterFinishedCallback(
617 base::Bind(&GpuCommandBufferStub::OnRescheduleAfterFinished,
618 base::Unretained(this)));
613 619
614 command_buffer_->SetPutOffsetChangeCallback( 620 command_buffer_->SetPutOffsetChangeCallback(
615 base::Bind(&GpuCommandBufferStub::PutChanged, base::Unretained(this))); 621 base::Bind(&GpuCommandBufferStub::PutChanged, base::Unretained(this)));
616 command_buffer_->SetGetBufferChangeCallback(base::Bind( 622 command_buffer_->SetGetBufferChangeCallback(base::Bind(
617 &CommandExecutor::SetGetBuffer, base::Unretained(executor_.get()))); 623 &CommandExecutor::SetGetBuffer, base::Unretained(executor_.get())));
618 command_buffer_->SetParseErrorCallback( 624 command_buffer_->SetParseErrorCallback(
619 base::Bind(&GpuCommandBufferStub::OnParseError, base::Unretained(this))); 625 base::Bind(&GpuCommandBufferStub::OnParseError, base::Unretained(this)));
620 626
621 if (channel_->watchdog()) { 627 if (channel_->watchdog()) {
622 executor_->SetCommandProcessedCallback(base::Bind( 628 executor_->SetCommandProcessedCallback(base::Bind(
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 context_group_->mailbox_manager(); 897 context_group_->mailbox_manager();
892 if (mailbox_manager->UsesSync() && MakeCurrent()) { 898 if (mailbox_manager->UsesSync() && MakeCurrent()) {
893 SyncToken sync_token(CommandBufferNamespace::GPU_IO, 0, 899 SyncToken sync_token(CommandBufferNamespace::GPU_IO, 0,
894 command_buffer_id_, release); 900 command_buffer_id_, release);
895 mailbox_manager->PushTextureUpdates(sync_token); 901 mailbox_manager->PushTextureUpdates(sync_token);
896 } 902 }
897 903
898 sync_point_client_->ReleaseFenceSync(release); 904 sync_point_client_->ReleaseFenceSync(release);
899 } 905 }
900 906
907 void GpuCommandBufferStub::OnDescheduleUntilFinished() {
908 DCHECK(executor_->scheduled());
909 DCHECK(executor_->HasMoreIdleWork());
910
911 executor_->SetScheduled(false);
912 channel_->OnStreamRescheduled(stream_id_, false);
913 }
914
915 void GpuCommandBufferStub::OnRescheduleAfterFinished() {
916 DCHECK(!executor_->scheduled());
917
918 executor_->SetScheduled(true);
919 channel_->OnStreamRescheduled(stream_id_, true);
920 }
921
901 bool GpuCommandBufferStub::OnWaitFenceSync( 922 bool GpuCommandBufferStub::OnWaitFenceSync(
902 CommandBufferNamespace namespace_id, 923 CommandBufferNamespace namespace_id,
903 CommandBufferId command_buffer_id, 924 CommandBufferId command_buffer_id,
904 uint64_t release) { 925 uint64_t release) {
905 DCHECK(!waiting_for_sync_point_); 926 DCHECK(!waiting_for_sync_point_);
906 DCHECK(executor_->scheduled()); 927 DCHECK(executor_->scheduled());
907 928
908 scoped_refptr<SyncPointClientState> release_state = 929 scoped_refptr<SyncPointClientState> release_state =
909 channel_->sync_point_manager()->GetSyncPointClientState( 930 channel_->sync_point_manager()->GetSyncPointClientState(
910 namespace_id, command_buffer_id); 931 namespace_id, command_buffer_id);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params)); 1111 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params));
1091 } 1112 }
1092 1113
1093 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, 1114 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase,
1094 base::TimeDelta interval) { 1115 base::TimeDelta interval) {
1095 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, 1116 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase,
1096 interval)); 1117 interval));
1097 } 1118 }
1098 1119
1099 } // namespace gpu 1120 } // namespace gpu
OLDNEW
« no previous file with comments | « 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