Chromium Code Reviews| 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/strings/string_util.h" | 10 #include "base/strings/string_util.h" | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 | 83 | 
| 84 GPUTrace::GPUTrace(scoped_refptr<Outputter> outputter, | 84 GPUTrace::GPUTrace(scoped_refptr<Outputter> outputter, | 
| 85 gfx::GPUTimingClient* gpu_timing_client, | 85 gfx::GPUTimingClient* gpu_timing_client, | 
| 86 const std::string& category, | 86 const std::string& category, | 
| 87 const std::string& name, | 87 const std::string& name, | 
| 88 const bool enabled) | 88 const bool enabled) | 
| 89 : category_(category), | 89 : category_(category), | 
| 90 name_(name), | 90 name_(name), | 
| 91 outputter_(outputter), | 91 outputter_(outputter), | 
| 92 enabled_(enabled) { | 92 enabled_(enabled) { | 
| 93 if (gpu_timing_client->IsAvailable() && | 93 if (enabled && | 
| 
 
vmiura
2015/04/10 22:18:50
Thinking about this, "enabled" here and "tracing_s
 
David Yen
2015/04/10 22:36:09
Done.
 
 | |
| 94 gpu_timing_client->IsAvailable() && | |
| 94 gpu_timing_client->IsTimerOffsetAvailable()) { | 95 gpu_timing_client->IsTimerOffsetAvailable()) { | 
| 95 gpu_timer_ = gpu_timing_client->CreateGPUTimer(); | 96 gpu_timer_ = gpu_timing_client->CreateGPUTimer(); | 
| 96 } | 97 } | 
| 97 } | 98 } | 
| 98 | 99 | 
| 99 GPUTrace::~GPUTrace() { | 100 GPUTrace::~GPUTrace() { | 
| 100 } | 101 } | 
| 101 | 102 | 
| 102 void GPUTrace::Destroy(bool have_context) { | 103 void GPUTrace::Destroy(bool have_context) { | 
| 103 if (gpu_timer_.get()) { | 104 if (gpu_timer_.get()) { | 
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 363 void GPUTracer::IssueProcessTask() { | 364 void GPUTracer::IssueProcessTask() { | 
| 364 if (finished_traces_.empty() || process_posted_) | 365 if (finished_traces_.empty() || process_posted_) | 
| 365 return; | 366 return; | 
| 366 | 367 | 
| 367 process_posted_ = true; | 368 process_posted_ = true; | 
| 368 PostTask(); | 369 PostTask(); | 
| 369 } | 370 } | 
| 370 | 371 | 
| 371 } // namespace gles2 | 372 } // namespace gles2 | 
| 372 } // namespace gpu | 373 } // namespace gpu | 
| OLD | NEW |