OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/gpu_scheduler.h" | 5 #include "gpu/command_buffer/service/gpu_scheduler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } else { | 143 } else { |
144 ++unscheduled_count_; | 144 ++unscheduled_count_; |
145 if (unscheduled_count_ == 1) { | 145 if (unscheduled_count_ == 1) { |
146 TRACE_EVENT_ASYNC_BEGIN1("gpu", "ProcessingSwap", this, | 146 TRACE_EVENT_ASYNC_BEGIN1("gpu", "ProcessingSwap", this, |
147 "GpuScheduler", this); | 147 "GpuScheduler", this); |
148 #if defined(OS_WIN) | 148 #if defined(OS_WIN) |
149 if (base::win::GetVersion() < base::win::VERSION_VISTA) { | 149 if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
150 // When the scheduler transitions from scheduled to unscheduled, post a | 150 // When the scheduler transitions from scheduled to unscheduled, post a |
151 // delayed task that it will force it back into a scheduled state after | 151 // delayed task that it will force it back into a scheduled state after |
152 // a timeout. This should only be necessary on pre-Vista. | 152 // a timeout. This should only be necessary on pre-Vista. |
153 MessageLoop::current()->PostDelayedTask( | 153 base::MessageLoop::current()->PostDelayedTask( |
154 FROM_HERE, | 154 FROM_HERE, |
155 base::Bind(&GpuScheduler::RescheduleTimeOut, | 155 base::Bind(&GpuScheduler::RescheduleTimeOut, |
156 reschedule_task_factory_.GetWeakPtr()), | 156 reschedule_task_factory_.GetWeakPtr()), |
157 base::TimeDelta::FromMilliseconds(kRescheduleTimeOutDelay)); | 157 base::TimeDelta::FromMilliseconds(kRescheduleTimeOutDelay)); |
158 } | 158 } |
159 #endif | 159 #endif |
160 if (!scheduling_changed_callback_.is_null()) | 160 if (!scheduling_changed_callback_.is_null()) |
161 scheduling_changed_callback_.Run(false); | 161 scheduling_changed_callback_.Run(false); |
162 } | 162 } |
163 } | 163 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 base::Closure task_) | 302 base::Closure task_) |
303 : fence(fence_), | 303 : fence(fence_), |
304 issue_time(base::Time::Now()), | 304 issue_time(base::Time::Now()), |
305 task(task_) { | 305 task(task_) { |
306 } | 306 } |
307 | 307 |
308 GpuScheduler::UnscheduleFence::~UnscheduleFence() { | 308 GpuScheduler::UnscheduleFence::~UnscheduleFence() { |
309 } | 309 } |
310 | 310 |
311 } // namespace gpu | 311 } // namespace gpu |
OLD | NEW |