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

Side by Side Diff: gpu/command_buffer/service/gpu_scheduler.cc

Issue 14273038: gpu: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/ring_buffer_test.cc ('k') | gpu/command_buffer/service/gpu_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698