OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains the GPUTrace class. | 5 // This file contains the GPUTrace class. |
6 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ | 6 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ |
7 #define GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ | 7 #define GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 std::string category_; | 43 std::string category_; |
44 std::string name_; | 44 std::string name_; |
45 scoped_refptr<GPUTrace> trace_; | 45 scoped_refptr<GPUTrace> trace_; |
46 }; | 46 }; |
47 | 47 |
48 // Traces GPU Commands. | 48 // Traces GPU Commands. |
49 class GPU_EXPORT GPUTracer | 49 class GPU_EXPORT GPUTracer |
50 : public base::SupportsWeakPtr<GPUTracer> { | 50 : public base::SupportsWeakPtr<GPUTracer> { |
51 public: | 51 public: |
52 explicit GPUTracer(gles2::GLES2Decoder* decoder); | 52 GPUTracer(gles2::GLES2Decoder* decoder, GPUTiming* gpu_timing); |
53 virtual ~GPUTracer(); | 53 virtual ~GPUTracer(); |
54 | 54 |
55 // Scheduled processing in decoder begins. | 55 // Scheduled processing in decoder begins. |
56 bool BeginDecoding(); | 56 bool BeginDecoding(); |
57 | 57 |
58 // Scheduled processing in decoder ends. | 58 // Scheduled processing in decoder ends. |
59 bool EndDecoding(); | 59 bool EndDecoding(); |
60 | 60 |
61 // Begin a trace marker. | 61 // Begin a trace marker. |
62 bool Begin(const std::string& category, const std::string& name, | 62 bool Begin(const std::string& category, const std::string& name, |
(...skipping 19 matching lines...) Expand all Loading... |
82 | 82 |
83 void IssueProcessTask(); | 83 void IssueProcessTask(); |
84 | 84 |
85 scoped_refptr<Outputter> outputter_; | 85 scoped_refptr<Outputter> outputter_; |
86 std::vector<TraceMarker> markers_[NUM_TRACER_SOURCES]; | 86 std::vector<TraceMarker> markers_[NUM_TRACER_SOURCES]; |
87 std::deque<scoped_refptr<GPUTrace> > traces_; | 87 std::deque<scoped_refptr<GPUTrace> > traces_; |
88 | 88 |
89 const unsigned char* gpu_trace_srv_category; | 89 const unsigned char* gpu_trace_srv_category; |
90 const unsigned char* gpu_trace_dev_category; | 90 const unsigned char* gpu_trace_dev_category; |
91 gles2::GLES2Decoder* decoder_; | 91 gles2::GLES2Decoder* decoder_; |
92 gpu::GPUTiming gpu_timing_; | 92 GPUTiming* gpu_timing_; |
| 93 int disjoint_context_id_; |
93 | 94 |
94 bool gpu_executing_; | 95 bool gpu_executing_; |
95 bool process_posted_; | 96 bool process_posted_; |
96 | 97 |
97 private: | 98 private: |
98 DISALLOW_COPY_AND_ASSIGN(GPUTracer); | 99 DISALLOW_COPY_AND_ASSIGN(GPUTracer); |
99 }; | 100 }; |
100 | 101 |
101 class Outputter : public base::RefCounted<Outputter> { | 102 class Outputter : public base::RefCounted<Outputter> { |
102 public: | 103 public: |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 uint64 local_trace_id_; | 140 uint64 local_trace_id_; |
140 | 141 |
141 private: | 142 private: |
142 DISALLOW_COPY_AND_ASSIGN(TraceOutputter); | 143 DISALLOW_COPY_AND_ASSIGN(TraceOutputter); |
143 }; | 144 }; |
144 | 145 |
145 class GPU_EXPORT GPUTrace | 146 class GPU_EXPORT GPUTrace |
146 : public base::RefCounted<GPUTrace> { | 147 : public base::RefCounted<GPUTrace> { |
147 public: | 148 public: |
148 GPUTrace(scoped_refptr<Outputter> outputter, | 149 GPUTrace(scoped_refptr<Outputter> outputter, |
149 gpu::GPUTiming* gpu_timing, | 150 GPUTiming* gpu_timing, |
150 const std::string& category, | 151 const std::string& category, |
151 const std::string& name, | 152 const std::string& name, |
152 const bool enabled); | 153 const bool enabled); |
153 | 154 |
154 void Start(bool trace_service); | 155 void Start(bool trace_service); |
155 void End(bool tracing_service); | 156 void End(bool tracing_service); |
156 bool IsAvailable(); | 157 bool IsAvailable(); |
157 bool IsEnabled() { return enabled_; } | 158 bool IsEnabled() { return enabled_; } |
158 void Process(); | 159 void Process(); |
159 | 160 |
(...skipping 27 matching lines...) Expand all Loading... |
187 | 188 |
188 private: | 189 private: |
189 GPUTracer* gpu_tracer_; | 190 GPUTracer* gpu_tracer_; |
190 GpuTracerSource source_; | 191 GpuTracerSource source_; |
191 }; | 192 }; |
192 | 193 |
193 } // namespace gles2 | 194 } // namespace gles2 |
194 } // namespace gpu | 195 } // namespace gpu |
195 | 196 |
196 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ | 197 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ |
OLD | NEW |