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_tracer.h" | 5 #include "gpu/command_buffer/service/gpu_tracer.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 277 |
278 scoped_refptr<Trace> GPUTracerImpl::CreateTrace(const std::string& name) { | 278 scoped_refptr<Trace> GPUTracerImpl::CreateTrace(const std::string& name) { |
279 return new NoopTrace(name); | 279 return new NoopTrace(name); |
280 } | 280 } |
281 | 281 |
282 void GPUTracerImpl::IssueProcessTask() { | 282 void GPUTracerImpl::IssueProcessTask() { |
283 if (traces_.empty() || process_posted_) | 283 if (traces_.empty() || process_posted_) |
284 return; | 284 return; |
285 | 285 |
286 process_posted_ = true; | 286 process_posted_ = true; |
287 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 287 base::MessageLoop::current()->PostDelayedTask( |
| 288 FROM_HERE, |
288 base::Bind(&GPUTracerImpl::Process, base::AsWeakPtr(this)), | 289 base::Bind(&GPUTracerImpl::Process, base::AsWeakPtr(this)), |
289 base::TimeDelta::FromMilliseconds(kProcessInterval)); | 290 base::TimeDelta::FromMilliseconds(kProcessInterval)); |
290 } | 291 } |
291 | 292 |
292 GPUTracerARBTimerQuery::GPUTracerARBTimerQuery() | 293 GPUTracerARBTimerQuery::GPUTracerARBTimerQuery() |
293 : GPUTracerImpl(), | 294 : GPUTracerImpl(), |
294 timer_offset_(0), | 295 timer_offset_(0), |
295 last_offset_check_(0) { | 296 last_offset_check_(0) { |
296 CalculateTimerOffset(); | 297 CalculateTimerOffset(); |
297 outputter_ = Outputter::Create("GL_ARB_timer_query"); | 298 outputter_ = Outputter::Create("GL_ARB_timer_query"); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 } // namespace | 338 } // namespace |
338 | 339 |
339 scoped_ptr<GPUTracer> GPUTracer::Create() { | 340 scoped_ptr<GPUTracer> GPUTracer::Create() { |
340 if (gfx::g_driver_gl.ext.b_GL_ARB_timer_query) | 341 if (gfx::g_driver_gl.ext.b_GL_ARB_timer_query) |
341 return scoped_ptr<GPUTracer>(new GPUTracerARBTimerQuery()); | 342 return scoped_ptr<GPUTracer>(new GPUTracerARBTimerQuery()); |
342 return scoped_ptr<GPUTracer>(new GPUTracerImpl()); | 343 return scoped_ptr<GPUTracer>(new GPUTracerImpl()); |
343 } | 344 } |
344 | 345 |
345 } // namespace gles2 | 346 } // namespace gles2 |
346 } // namespace gpu | 347 } // namespace gpu |
OLD | NEW |