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

Unified Diff: gpu/command_buffer/service/gpu_tracer.h

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698