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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 trace_service_id_stack_[source].pop(); | 118 trace_service_id_stack_[source].pop(); |
119 | 119 |
120 TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TTS2( | 120 TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TTS2( |
121 TRACE_DISABLED_BY_DEFAULT("gpu.service"), | 121 TRACE_DISABLED_BY_DEFAULT("gpu.service"), |
122 name.c_str(), local_trace_id, | 122 name.c_str(), local_trace_id, |
123 "gl_category", category.c_str(), | 123 "gl_category", category.c_str(), |
124 "channel", kGpuTraceSourceNames[source]); | 124 "channel", kGpuTraceSourceNames[source]); |
125 } | 125 } |
126 | 126 |
127 GPUTrace::GPUTrace(scoped_refptr<Outputter> outputter, | 127 GPUTrace::GPUTrace(scoped_refptr<Outputter> outputter, |
128 gfx::GPUTimingClient* gpu_timing_client, | 128 gl::GPUTimingClient* gpu_timing_client, |
129 const GpuTracerSource source, | 129 const GpuTracerSource source, |
130 const std::string& category, | 130 const std::string& category, |
131 const std::string& name, | 131 const std::string& name, |
132 const bool tracing_service, | 132 const bool tracing_service, |
133 const bool tracing_device) | 133 const bool tracing_device) |
134 : source_(source), | 134 : source_(source), |
135 category_(category), | 135 category_(category), |
136 name_(name), | 136 name_(name), |
137 outputter_(outputter), | 137 outputter_(outputter), |
138 service_enabled_(tracing_service), | 138 service_enabled_(tracing_service), |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 GPUTracer::GPUTracer(gles2::GLES2Decoder* decoder) | 186 GPUTracer::GPUTracer(gles2::GLES2Decoder* decoder) |
187 : gpu_trace_srv_category(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( | 187 : gpu_trace_srv_category(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( |
188 TRACE_DISABLED_BY_DEFAULT("gpu.service"))), | 188 TRACE_DISABLED_BY_DEFAULT("gpu.service"))), |
189 gpu_trace_dev_category(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( | 189 gpu_trace_dev_category(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( |
190 TRACE_DISABLED_BY_DEFAULT("gpu.device"))), | 190 TRACE_DISABLED_BY_DEFAULT("gpu.device"))), |
191 decoder_(decoder) { | 191 decoder_(decoder) { |
192 DCHECK(decoder_); | 192 DCHECK(decoder_); |
193 gfx::GLContext* context = decoder_->GetGLContext(); | 193 gl::GLContext* context = decoder_->GetGLContext(); |
194 if (context) { | 194 if (context) { |
195 gpu_timing_client_ = context->CreateGPUTimingClient(); | 195 gpu_timing_client_ = context->CreateGPUTimingClient(); |
196 } else { | 196 } else { |
197 gpu_timing_client_ = new gfx::GPUTimingClient(); | 197 gpu_timing_client_ = new gl::GPUTimingClient(); |
198 } | 198 } |
199 | 199 |
200 disjoint_time_ = gpu_timing_client_->GetCurrentCPUTime(); | 200 disjoint_time_ = gpu_timing_client_->GetCurrentCPUTime(); |
201 } | 201 } |
202 | 202 |
203 GPUTracer::~GPUTracer() { | 203 GPUTracer::~GPUTracer() { |
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); |
(...skipping 204 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 |