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

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

Issue 12340118: GPU: Only allow the UI channel to preempt if all stubs are scheduled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit. Created 7 years, 10 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/command_buffer/service/gpu_scheduler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gpu_scheduler.cc
diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc
index 78739dca5fcf9b0899c97e2aeb15b59ec0cdc6bd..61bdcf8470e652631741885edcef724f8f94fb81 100644
--- a/gpu/command_buffer/service/gpu_scheduler.cc
+++ b/gpu/command_buffer/service/gpu_scheduler.cc
@@ -136,11 +136,12 @@ void GpuScheduler::SetScheduled(bool scheduled) {
// state, cancel the task that would reschedule it after a timeout.
reschedule_task_factory_.InvalidateWeakPtrs();
- if (!scheduled_callback_.is_null())
- scheduled_callback_.Run();
+ if (!scheduling_changed_callback_.is_null())
+ scheduling_changed_callback_.Run(true);
}
} else {
- if (unscheduled_count_ == 0) {
+ ++unscheduled_count_;
+ if (unscheduled_count_ == 1) {
TRACE_EVENT_ASYNC_BEGIN1("gpu", "ProcessingSwap", this,
"GpuScheduler", this);
#if defined(OS_WIN)
@@ -155,9 +156,9 @@ void GpuScheduler::SetScheduled(bool scheduled) {
base::TimeDelta::FromMilliseconds(kRescheduleTimeOutDelay));
}
#endif
+ if (!scheduling_changed_callback_.is_null())
+ scheduling_changed_callback_.Run(false);
}
-
- ++unscheduled_count_;
}
}
@@ -170,9 +171,9 @@ bool GpuScheduler::HasMoreWork() {
(decoder_ && decoder_->ProcessPendingQueries());
}
-void GpuScheduler::SetScheduledCallback(
- const base::Closure& scheduled_callback) {
- scheduled_callback_ = scheduled_callback;
+void GpuScheduler::SetSchedulingChangedCallback(
+ const SchedulingChangedCallback& callback) {
+ scheduling_changed_callback_ = callback;
}
Buffer GpuScheduler::GetSharedMemoryBuffer(int32 shm_id) {
« no previous file with comments | « gpu/command_buffer/service/gpu_scheduler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698