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

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

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 | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | gpu/command_buffer/service/gpu_scheduler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gpu_scheduler.h
diff --git a/gpu/command_buffer/service/gpu_scheduler.h b/gpu/command_buffer/service/gpu_scheduler.h
index 32a38b9de0873516a74d735527bc6856778b4fee..0e58d8c19ad60e8d6fd4381a247453350e168df9 100644
--- a/gpu/command_buffer/service/gpu_scheduler.h
+++ b/gpu/command_buffer/service/gpu_scheduler.h
@@ -76,9 +76,11 @@ class GPU_EXPORT GpuScheduler
// Returns whether the scheduler needs to be polled again in the future.
bool HasMoreWork();
- // Sets a callback that is invoked just before scheduler is rescheduled.
- // Takes ownership of callback object.
- void SetScheduledCallback(const base::Closure& scheduled_callback);
+ typedef base::Callback<void(bool /* scheduled */)> SchedulingChangedCallback;
+
+ // Sets a callback that is invoked just before scheduler is rescheduled
+ // or descheduled. Takes ownership of callback object.
+ void SetSchedulingChangedCallback(const SchedulingChangedCallback& callback);
// Implementation of CommandBufferEngine.
virtual Buffer GetSharedMemoryBuffer(int32 shm_id) OVERRIDE;
@@ -146,7 +148,8 @@ class GPU_EXPORT GpuScheduler
};
std::queue<linked_ptr<UnscheduleFence> > unschedule_fences_;
- base::Closure scheduled_callback_;
+ SchedulingChangedCallback scheduling_changed_callback_;
+ base::Closure descheduled_callback_;
base::Closure command_processed_callback_;
// If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early.
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | gpu/command_buffer/service/gpu_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698