Chromium Code Reviews| 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 2a15dc76f9c06d14914f5b2470a5c758f8eeeb4e..75ce9c4f6cea7fa83ec1571c8a52350734d203a4 100644 |
| --- a/gpu/command_buffer/service/gpu_scheduler.cc |
| +++ b/gpu/command_buffer/service/gpu_scheduler.cc |
| @@ -34,12 +34,9 @@ GpuScheduler::GpuScheduler(CommandBufferServiceBase* command_buffer, |
| handler_(handler), |
| decoder_(decoder), |
| unscheduled_count_(0), |
| - rescheduled_count_(0), |
| - was_preempted_(false), |
| - reschedule_task_factory_(this) {} |
| + was_preempted_(false) {} |
| -GpuScheduler::~GpuScheduler() { |
| -} |
| +GpuScheduler::~GpuScheduler() {} |
| void GpuScheduler::PutChanged() { |
| TRACE_EVENT1( |
| @@ -112,49 +109,15 @@ void GpuScheduler::SetScheduled(bool scheduled) { |
| "new unscheduled_count_", |
| unscheduled_count_ + (scheduled? -1 : 1)); |
| if (scheduled) { |
| - // If the scheduler was rescheduled after a timeout, ignore the subsequent |
| - // calls to SetScheduled when they eventually arrive until they are all |
| - // accounted for. |
| - if (rescheduled_count_ > 0) { |
| - --rescheduled_count_; |
| - return; |
| - } else { |
| - --unscheduled_count_; |
| - } |
| - |
| - DCHECK_GE(unscheduled_count_, 0); |
| - |
| - if (unscheduled_count_ == 0) { |
| - TRACE_EVENT_ASYNC_END1("gpu", "ProcessingSwap", this, |
| - "GpuScheduler", this); |
| - // When the scheduler transitions from the unscheduled to the scheduled |
| - // state, cancel the task that would reschedule it after a timeout. |
| - reschedule_task_factory_.InvalidateWeakPtrs(); |
| - |
| - if (!scheduling_changed_callback_.is_null()) |
| + --unscheduled_count_; |
| + if (unscheduled_count_ == 0 && !scheduling_changed_callback_.is_null()) |
| scheduling_changed_callback_.Run(true); |
| - } |
| } else { |
| ++unscheduled_count_; |
| - if (unscheduled_count_ == 1) { |
| - TRACE_EVENT_ASYNC_BEGIN1("gpu", "ProcessingSwap", this, |
| - "GpuScheduler", this); |
| -#if defined(OS_WIN) |
| - if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
| - // When the scheduler transitions from scheduled to unscheduled, post a |
| - // delayed task that it will force it back into a scheduled state after |
| - // a timeout. This should only be necessary on pre-Vista. |
| - base::MessageLoop::current()->PostDelayedTask( |
| - FROM_HERE, |
| - base::Bind(&GpuScheduler::RescheduleTimeOut, |
| - reschedule_task_factory_.GetWeakPtr()), |
| - base::TimeDelta::FromMilliseconds(kRescheduleTimeOutDelay)); |
| - } |
| -#endif |
|
piman
2015/09/16 21:46:29
What is the reason this is not needed any more? Is
sunnyps
2015/09/16 23:08:31
I do not know what everything else looked like whe
|
| - if (!scheduling_changed_callback_.is_null()) |
| + if (unscheduled_count_ == 1 && !scheduling_changed_callback_.is_null()) |
| scheduling_changed_callback_.Run(false); |
| - } |
| } |
| + DCHECK_GE(unscheduled_count_, 0); |
| } |
| bool GpuScheduler::IsScheduled() { |
| @@ -239,15 +202,4 @@ void GpuScheduler::PerformIdleWork() { |
| decoder_->PerformIdleWork(); |
| } |
| -void GpuScheduler::RescheduleTimeOut() { |
| - int new_count = unscheduled_count_ + rescheduled_count_; |
| - |
| - rescheduled_count_ = 0; |
| - |
| - while (unscheduled_count_) |
| - SetScheduled(true); |
| - |
| - rescheduled_count_ = new_count; |
| -} |
| - |
| } // namespace gpu |