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

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

Issue 509723002: Added support for GPU Tracing on mobile devices which support it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/gpu_tracer.cc » ('j') | gpu/command_buffer/service/gpu_tracer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « no previous file | gpu/command_buffer/service/gpu_tracer.cc » ('j') | gpu/command_buffer/service/gpu_tracer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698