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

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

Issue 2151673003: Only create the GPUTracer outputer when actually tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698