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

Unified Diff: gpu/command_buffer/service/command_executor.cc

Issue 2440093003: WIP GPU scheduler + delayed activation / tile draw
Patch Set: SignalSyncToken -> IsFenceSyncReleased Created 4 years 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/command_buffer/service/command_executor.h ('k') | gpu/command_buffer/service/gpu_preferences.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/command_executor.cc
diff --git a/gpu/command_buffer/service/command_executor.cc b/gpu/command_buffer/service/command_executor.cc
index ff7a910bf86a8263b70eae0440746003f5295e2b..0c4debec20bc329d9d71c9c018f8f96db33b5348 100644
--- a/gpu/command_buffer/service/command_executor.cc
+++ b/gpu/command_buffer/service/command_executor.cc
@@ -152,19 +152,26 @@ void CommandExecutor::SetCommandProcessedCallback(
command_processed_callback_ = callback;
}
+void CommandExecutor::SetPreemptionCallback(
+ const PreemptionCallback& callback) {
+ preemption_callback_ = callback;
+}
+
bool CommandExecutor::IsPreempted() {
- if (!preemption_flag_.get())
+ if (preemption_callback_.is_null())
return false;
- if (!was_preempted_ && preemption_flag_->IsSet()) {
+ bool preempt = preemption_callback_.Run();
+
+ if (!was_preempted_ && preempt) {
TRACE_COUNTER_ID1("gpu", "CommandExecutor::Preempted", this, 1);
was_preempted_ = true;
- } else if (was_preempted_ && !preemption_flag_->IsSet()) {
+ } else if (was_preempted_ && !preempt) {
TRACE_COUNTER_ID1("gpu", "CommandExecutor::Preempted", this, 0);
was_preempted_ = false;
}
- return preemption_flag_->IsSet();
+ return preempt;
}
bool CommandExecutor::HasMoreIdleWork() const {
« no previous file with comments | « gpu/command_buffer/service/command_executor.h ('k') | gpu/command_buffer/service/gpu_preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698