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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 while (!traces_.empty() && traces_.front()->IsAvailable()) { | 264 while (!traces_.empty() && traces_.front()->IsAvailable()) { |
265 traces_.front()->Process(); | 265 traces_.front()->Process(); |
266 traces_.pop_front(); | 266 traces_.pop_front(); |
267 } | 267 } |
268 | 268 |
269 IssueProcessTask(); | 269 IssueProcessTask(); |
270 } | 270 } |
271 | 271 |
272 const std::string& GPUTracerImpl::CurrentName() const { | 272 const std::string& GPUTracerImpl::CurrentName() const { |
273 if (!current_trace_.get()) | 273 if (!current_trace_.get()) |
274 return EmptyString(); | 274 return base::EmptyString(); |
275 return current_trace_->name(); | 275 return current_trace_->name(); |
276 } | 276 } |
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; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 } // namespace | 338 } // namespace |
339 | 339 |
340 scoped_ptr<GPUTracer> GPUTracer::Create() { | 340 scoped_ptr<GPUTracer> GPUTracer::Create() { |
341 if (gfx::g_driver_gl.ext.b_GL_ARB_timer_query) | 341 if (gfx::g_driver_gl.ext.b_GL_ARB_timer_query) |
342 return scoped_ptr<GPUTracer>(new GPUTracerARBTimerQuery()); | 342 return scoped_ptr<GPUTracer>(new GPUTracerARBTimerQuery()); |
343 return scoped_ptr<GPUTracer>(new GPUTracerImpl()); | 343 return scoped_ptr<GPUTracer>(new GPUTracerImpl()); |
344 } | 344 } |
345 | 345 |
346 } // namespace gles2 | 346 } // namespace gles2 |
347 } // namespace gpu | 347 } // namespace gpu |
OLD | NEW |