| Index: gpu/command_buffer/service/gpu_tracer.h
|
| diff --git a/gpu/command_buffer/service/gpu_tracer.h b/gpu/command_buffer/service/gpu_tracer.h
|
| index 64f13cc6f63eeeac1c29473b56750121fc4f96e0..594a98ebcbdc3532bf2eae34206c9cc1546f005e 100644
|
| --- a/gpu/command_buffer/service/gpu_tracer.h
|
| +++ b/gpu/command_buffer/service/gpu_tracer.h
|
| @@ -134,12 +134,10 @@ class Outputter : public base::RefCounted<Outputter> {
|
| int64 end_time) = 0;
|
|
|
| virtual void TraceServiceBegin(const std::string& category,
|
| - const std::string& name,
|
| - void* id) = 0;
|
| + const std::string& name) = 0;
|
|
|
| virtual void TraceServiceEnd(const std::string& category,
|
| - const std::string& name,
|
| - void* id) = 0;
|
| + const std::string& name) = 0;
|
|
|
| protected:
|
| virtual ~Outputter() {}
|
| @@ -155,12 +153,10 @@ class TraceOutputter : public Outputter {
|
| int64 end_time) override;
|
|
|
| void TraceServiceBegin(const std::string& category,
|
| - const std::string& name,
|
| - void* id) override;
|
| + const std::string& name) override;
|
|
|
| void TraceServiceEnd(const std::string& category,
|
| - const std::string& name,
|
| - void* id) override;
|
| + const std::string& name) override;
|
|
|
| protected:
|
| friend class base::RefCounted<Outputter>;
|
| @@ -213,6 +209,24 @@ class GPU_EXPORT GPUTrace
|
| DISALLOW_COPY_AND_ASSIGN(GPUTrace);
|
| };
|
|
|
| +class ScopedGPUTrace {
|
| + public:
|
| + ScopedGPUTrace(GPUTracer* gpu_tracer, GpuTracerSource source,
|
| + const std::string& category, const std::string& name)
|
| + : gpu_tracer_(gpu_tracer),
|
| + source_(source) {
|
| + gpu_tracer_->Begin(category, name, source_);
|
| + }
|
| +
|
| + ~ScopedGPUTrace() {
|
| + gpu_tracer_->End(source_);
|
| + }
|
| +
|
| + private:
|
| + GPUTracer* gpu_tracer_;
|
| + GpuTracerSource source_;
|
| +};
|
| +
|
| } // namespace gles2
|
| } // namespace gpu
|
|
|
|
|