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

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

Issue 2171553004: gpu: Fix crash in gpu tracer (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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 bool GPUTracer::Begin(const std::string& category, const std::string& name, 264 bool GPUTracer::Begin(const std::string& category, const std::string& name,
265 GpuTracerSource source) { 265 GpuTracerSource source) {
266 if (!gpu_executing_) 266 if (!gpu_executing_)
267 return false; 267 return false;
268 268
269 DCHECK(source >= 0 && source < NUM_TRACER_SOURCES); 269 DCHECK(source >= 0 && source < NUM_TRACER_SOURCES);
270 270
271 // Push new marker from given 'source' 271 // Push new marker from given 'source'
272 markers_[source].push_back(TraceMarker(category, name)); 272 markers_[source].push_back(TraceMarker(category, name));
273 273
274 if (!outputter_) {
275 outputter_ = CreateOutputter(gpu_timing_client_->GetTimerTypeName());
276 }
277
274 // Create trace 278 // Create trace
275 if (IsTracing()) { 279 if (IsTracing()) {
276 began_device_traces_ |= (*gpu_trace_dev_category != 0); 280 began_device_traces_ |= (*gpu_trace_dev_category != 0);
277 scoped_refptr<GPUTrace> trace = new GPUTrace( 281 scoped_refptr<GPUTrace> trace = new GPUTrace(
278 outputter_, gpu_timing_client_.get(), source, category, name, 282 outputter_, gpu_timing_client_.get(), source, category, name,
279 *gpu_trace_srv_category != 0, 283 *gpu_trace_srv_category != 0,
280 *gpu_trace_dev_category != 0); 284 *gpu_trace_dev_category != 0);
281 trace->Start(); 285 trace->Start();
282 markers_[source].back().trace_ = trace; 286 markers_[source].back().trace_ = trace;
283 } 287 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } 416 }
413 417
414 while (!finished_traces_.empty()) { 418 while (!finished_traces_.empty()) {
415 finished_traces_.front()->Destroy(have_context); 419 finished_traces_.front()->Destroy(have_context);
416 finished_traces_.pop_front(); 420 finished_traces_.pop_front();
417 } 421 }
418 } 422 }
419 423
420 } // namespace gles2 424 } // namespace gles2
421 } // namespace gpu 425 } // 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