| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 virtual ~NoopTrace() {} | 121 virtual ~NoopTrace() {} |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(NoopTrace); | 123 DISALLOW_COPY_AND_ASSIGN(NoopTrace); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 class GPUTracerImpl | 126 class GPUTracerImpl |
| 127 : public GPUTracer, | 127 : public GPUTracer, |
| 128 public base::SupportsWeakPtr<GPUTracerImpl> { | 128 public base::SupportsWeakPtr<GPUTracerImpl> { |
| 129 public: | 129 public: |
| 130 GPUTracerImpl() | 130 GPUTracerImpl() |
| 131 : gpu_category_enabled_(TRACE_EVENT_API_GET_CATEGORY_ENABLED("gpu")), | 131 : gpu_category_enabled_( |
| 132 TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED("gpu")), |
| 132 process_posted_(false) { | 133 process_posted_(false) { |
| 133 } | 134 } |
| 134 virtual ~GPUTracerImpl() {} | 135 virtual ~GPUTracerImpl() {} |
| 135 | 136 |
| 136 // Implementation of gpu::gles2::GPUTracer | 137 // Implementation of gpu::gles2::GPUTracer |
| 137 virtual bool Begin(const std::string& name) OVERRIDE; | 138 virtual bool Begin(const std::string& name) OVERRIDE; |
| 138 virtual bool End() OVERRIDE; | 139 virtual bool End() OVERRIDE; |
| 139 virtual const std::string& CurrentName() const OVERRIDE; | 140 virtual const std::string& CurrentName() const OVERRIDE; |
| 140 | 141 |
| 141 // Process any completed traces. | 142 // Process any completed traces. |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 } // namespace | 337 } // namespace |
| 337 | 338 |
| 338 scoped_ptr<GPUTracer> GPUTracer::Create() { | 339 scoped_ptr<GPUTracer> GPUTracer::Create() { |
| 339 if (gfx::g_driver_gl.ext.b_GL_ARB_timer_query) | 340 if (gfx::g_driver_gl.ext.b_GL_ARB_timer_query) |
| 340 return scoped_ptr<GPUTracer>(new GPUTracerARBTimerQuery()); | 341 return scoped_ptr<GPUTracer>(new GPUTracerARBTimerQuery()); |
| 341 return scoped_ptr<GPUTracer>(new GPUTracerImpl()); | 342 return scoped_ptr<GPUTracer>(new GPUTracerImpl()); |
| 342 } | 343 } |
| 343 | 344 |
| 344 } // namespace gles2 | 345 } // namespace gles2 |
| 345 } // namespace gpu | 346 } // namespace gpu |
| OLD | NEW |