| 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 5aa2cd8a4e07e49ab5379a8fa344c9891ed0a498..1d04777dfad391c8a7cddbc602aa6b72be854c64 100644
|
| --- a/gpu/command_buffer/service/gpu_tracer.h
|
| +++ b/gpu/command_buffer/service/gpu_tracer.h
|
| @@ -33,6 +33,13 @@ enum GpuTracerSource {
|
| NUM_TRACER_SOURCES
|
| };
|
|
|
| +enum GpuTracerType {
|
| + kTracerTypeInvalid = -1,
|
| +
|
| + kTracerTypeARBTimer,
|
| + kTracerTypeDisjointTimer
|
| +};
|
| +
|
| // Marker structure for a Trace.
|
| struct TraceMarker {
|
| TraceMarker(const std::string& name);
|
| @@ -60,6 +67,9 @@ class GPUTracer : public base::SupportsWeakPtr<GPUTracer> {
|
| // End the last started trace marker.
|
| bool End(GpuTracerSource source);
|
|
|
| + // Discard data obtained from current trace.
|
| + void DiscardTrace();
|
| +
|
| bool IsTracing();
|
|
|
| // Retrieve the name of the current open trace.
|
| @@ -86,7 +96,7 @@ class GPUTracer : public base::SupportsWeakPtr<GPUTracer> {
|
| int64 timer_offset_;
|
| GpuTracerSource last_tracer_source_;
|
|
|
| - bool enabled_;
|
| + GpuTracerType tracer_type_;
|
| bool gpu_timing_synced_;
|
| bool gpu_executing_;
|
| bool process_posted_;
|
| @@ -126,18 +136,19 @@ class TraceOutputter : public Outputter {
|
| class GPU_EXPORT GPUTrace
|
| : public base::RefCounted<GPUTrace> {
|
| public:
|
| - explicit GPUTrace(const std::string& name);
|
| GPUTrace(scoped_refptr<Outputter> outputter,
|
| const std::string& name,
|
| - int64 offset);
|
| + int64 offset,
|
| + GpuTracerType tracer_type);
|
|
|
| - bool IsEnabled() { return enabled_; }
|
| + bool IsEnabled() { return tracer_type_ != kTracerTypeInvalid; }
|
| const std::string& name() { return name_; }
|
|
|
| void Start();
|
| void End();
|
| bool IsAvailable();
|
| void Process();
|
| + void DiscardTrace();
|
|
|
| private:
|
| ~GPUTrace();
|
| @@ -152,8 +163,9 @@ class GPU_EXPORT GPUTrace
|
| int64 offset_;
|
| int64 start_time_;
|
| int64 end_time_;
|
| + GpuTracerType tracer_type_;
|
| bool end_requested_;
|
| - bool enabled_;
|
| + bool discard_trace_;
|
|
|
| GLuint queries_[2];
|
|
|
|
|