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

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

Issue 799753009: Added GPU Tracing for DoSwapBuffers() to track frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use generic scoped gpu tracer Created 5 years, 11 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 | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | 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 // This file contains the GPUTrace class. 5 // This file contains the GPUTrace class.
6 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ 6 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_
7 #define GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ 7 #define GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 int64 start_time_; 206 int64 start_time_;
207 int64 end_time_; 207 int64 end_time_;
208 GpuTracerType tracer_type_; 208 GpuTracerType tracer_type_;
209 bool end_requested_; 209 bool end_requested_;
210 210
211 GLuint queries_[2]; 211 GLuint queries_[2];
212 212
213 DISALLOW_COPY_AND_ASSIGN(GPUTrace); 213 DISALLOW_COPY_AND_ASSIGN(GPUTrace);
214 }; 214 };
215 215
216 class ScopedGPUTrace {
217 public:
218 ScopedGPUTrace(GPUTracer* gpu_tracer, GpuTracerSource source,
219 const std::string& category, const std::string& name)
220 : gpu_tracer_(gpu_tracer),
221 source_(source) {
222 gpu_tracer_->Begin(category, name, source_);
223 }
224
225 ~ScopedGPUTrace() {
226 gpu_tracer_->End(source_);
227 }
228
229 private:
230 GPUTracer* gpu_tracer_;
231 GpuTracerSource source_;
232 };
233
216 } // namespace gles2 234 } // namespace gles2
217 } // namespace gpu 235 } // namespace gpu
218 236
219 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ 237 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698