| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 204 } |
| 205 | 205 |
| 206 void GPUTracer::Destroy(bool have_context) { | 206 void GPUTracer::Destroy(bool have_context) { |
| 207 ClearOngoingTraces(have_context); | 207 ClearOngoingTraces(have_context); |
| 208 } | 208 } |
| 209 | 209 |
| 210 bool GPUTracer::BeginDecoding() { | 210 bool GPUTracer::BeginDecoding() { |
| 211 if (gpu_executing_) | 211 if (gpu_executing_) |
| 212 return false; | 212 return false; |
| 213 | 213 |
| 214 if (!outputter_) { | |
| 215 outputter_ = CreateOutputter(gpu_timing_client_->GetTimerTypeName()); | |
| 216 } | |
| 217 | |
| 218 gpu_executing_ = true; | 214 gpu_executing_ = true; |
| 219 if (IsTracing()) { | 215 if (IsTracing()) { |
| 216 if (!outputter_) { |
| 217 outputter_ = CreateOutputter(gpu_timing_client_->GetTimerTypeName()); |
| 218 } |
| 219 |
| 220 CheckDisjointStatus(); | 220 CheckDisjointStatus(); |
| 221 // Begin a Trace for all active markers | 221 // Begin a Trace for all active markers |
| 222 for (int n = 0; n < NUM_TRACER_SOURCES; n++) { | 222 for (int n = 0; n < NUM_TRACER_SOURCES; n++) { |
| 223 for (size_t i = 0; i < markers_[n].size(); i++) { | 223 for (size_t i = 0; i < markers_[n].size(); i++) { |
| 224 began_device_traces_ |= (*gpu_trace_dev_category != 0); | 224 began_device_traces_ |= (*gpu_trace_dev_category != 0); |
| 225 TraceMarker& trace_marker = markers_[n][i]; | 225 TraceMarker& trace_marker = markers_[n][i]; |
| 226 trace_marker.trace_ = | 226 trace_marker.trace_ = |
| 227 new GPUTrace(outputter_, gpu_timing_client_.get(), | 227 new GPUTrace(outputter_, gpu_timing_client_.get(), |
| 228 static_cast<GpuTracerSource>(n), | 228 static_cast<GpuTracerSource>(n), |
| 229 trace_marker.category_, trace_marker.name_, | 229 trace_marker.category_, trace_marker.name_, |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 } | 412 } |
| 413 | 413 |
| 414 while (!finished_traces_.empty()) { | 414 while (!finished_traces_.empty()) { |
| 415 finished_traces_.front()->Destroy(have_context); | 415 finished_traces_.front()->Destroy(have_context); |
| 416 finished_traces_.pop_front(); | 416 finished_traces_.pop_front(); |
| 417 } | 417 } |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace gles2 | 420 } // namespace gles2 |
| 421 } // namespace gpu | 421 } // namespace gpu |
| OLD | NEW |