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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/service/gpu_command_buffer_stub.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/gpu_command_buffer_stub.cc
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc
index 8cc19d9ffc4662b2129560f6891552d033551846..89f531f7b00a390dc412452edb06d1f2b5650dd1 100644
--- a/gpu/ipc/service/gpu_command_buffer_stub.cc
+++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
@@ -610,6 +610,12 @@ bool GpuCommandBufferStub::Initialize(
&GpuCommandBufferStub::OnFenceSyncRelease, base::Unretained(this)));
decoder_->SetWaitFenceSyncCallback(base::Bind(
&GpuCommandBufferStub::OnWaitFenceSync, base::Unretained(this)));
+ decoder_->SetDescheduleUntilFinishedCallback(
+ base::Bind(&GpuCommandBufferStub::OnDescheduleUntilFinished,
+ base::Unretained(this)));
+ decoder_->SetRescheduleAfterFinishedCallback(
+ base::Bind(&GpuCommandBufferStub::OnRescheduleAfterFinished,
+ base::Unretained(this)));
command_buffer_->SetPutOffsetChangeCallback(
base::Bind(&GpuCommandBufferStub::PutChanged, base::Unretained(this)));
@@ -898,6 +904,21 @@ void GpuCommandBufferStub::OnFenceSyncRelease(uint64_t release) {
sync_point_client_->ReleaseFenceSync(release);
}
+void GpuCommandBufferStub::OnDescheduleUntilFinished() {
+ DCHECK(executor_->scheduled());
+ DCHECK(executor_->HasMoreIdleWork());
+
+ executor_->SetScheduled(false);
+ channel_->OnStreamRescheduled(stream_id_, false);
+}
+
+void GpuCommandBufferStub::OnRescheduleAfterFinished() {
+ DCHECK(!executor_->scheduled());
+
+ executor_->SetScheduled(true);
+ channel_->OnStreamRescheduled(stream_id_, true);
+}
+
bool GpuCommandBufferStub::OnWaitFenceSync(
CommandBufferNamespace namespace_id,
CommandBufferId command_buffer_id,
« 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