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

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

Issue 419073008: Simplified GPU Tracer by removing parent base class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 7daea897db644060e2aa669fa87d6c865cf21a6b..7e399a3a0c1248a518b094fcf55907a366440c02 100644
--- a/gpu/command_buffer/service/gpu_tracer.h
+++ b/gpu/command_buffer/service/gpu_tracer.h
@@ -19,40 +19,79 @@
namespace gpu {
namespace gles2 {
+class Outputter;
+class Trace;
+
// Id used to keep trace namespaces separate
enum GpuTracerSource {
+ kTraceGroupInvalid = -1,
+
kTraceGroupMarker = 0,
kTraceCHROMIUM = 1,
kTraceDecoder = 2,
+
+ NUM_TRACER_SOURCES
+};
+
+// Marker structure for a Trace.
+struct TraceMarker {
+ TraceMarker(const std::string& name)
+ : name_(name), trace_(NULL) {}
+
+ std::string name_;
+ scoped_refptr<Trace> trace_;
};
// Traces GPU Commands.
-class GPUTracer {
+class GPUTracer : public base::SupportsWeakPtr<GPUTracer> {
public:
- static scoped_ptr<GPUTracer> Create(gles2::GLES2Decoder* decoder);
-
- GPUTracer();
- virtual ~GPUTracer();
+ GPUTracer(gles2::GLES2Decoder* decoder);
+ ~GPUTracer();
// Scheduled processing in decoder begins.
- virtual bool BeginDecoding() = 0;
+ bool BeginDecoding();
// Scheduled processing in decoder ends.
- virtual bool EndDecoding() = 0;
+ bool EndDecoding();
// Begin a trace marker.
- virtual bool Begin(const std::string& name, GpuTracerSource source) = 0;
+ bool Begin(const std::string& name, GpuTracerSource source);
// End the last started trace marker.
- virtual bool End(GpuTracerSource source) = 0;
+ bool End(GpuTracerSource source);
- virtual bool IsTracing() = 0;
+ bool IsTracing();
// Retrieve the name of the current open trace.
// Returns empty string if no current open trace.
- virtual const std::string& CurrentName() const = 0;
+ const std::string& CurrentName() const;
+
+ void CalculateTimerOffset();
vmiura 2014/07/29 23:45:31 Should this be private?
David Yen 2014/08/04 22:20:05 Done.
private:
+ // Trace Processing.
+ scoped_refptr<Trace> CreateTrace(const std::string& name);
+ void Process();
+ void ProcessTraces();
+
+ void IssueProcessTask();
+
+ scoped_refptr<Outputter> outputter_;
+ std::vector<TraceMarker> markers_[NUM_TRACER_SOURCES];
+ std::deque<scoped_refptr<Trace> > traces_;
+
+ const unsigned char* gpu_trace_srv_category;
+ const unsigned char* gpu_trace_dev_category;
+ gles2::GLES2Decoder* decoder_;
+
+ int64 timer_offset_;
+ GpuTracerSource last_tracer_source_;
+
+ bool enabled_;
+ bool gpu_timing_synced_;
+ bool gpu_executing_;
+ bool process_posted_;
+
DISALLOW_COPY_AND_ASSIGN(GPUTracer);
};

Powered by Google App Engine
This is Rietveld 408576698