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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 | 43 |
44 std::string category_; | 44 std::string category_; |
45 std::string name_; | 45 std::string name_; |
46 scoped_refptr<GPUTrace> trace_; | 46 scoped_refptr<GPUTrace> trace_; |
47 }; | 47 }; |
48 | 48 |
49 // Traces GPU Commands. | 49 // Traces GPU Commands. |
50 class GPU_EXPORT GPUTracer | 50 class GPU_EXPORT GPUTracer |
51 : public base::SupportsWeakPtr<GPUTracer> { | 51 : public base::SupportsWeakPtr<GPUTracer> { |
52 public: | 52 public: |
53 explicit GPUTracer(gles2::GLES2Decoder* decoder); | 53 explicit GPUTracer(gles2::GLES2Decoder* decoder, GPUTiming* gpu_timing); |
Daniele Castagna
2015/02/19 18:15:32
nit: remove explicit
David Yen
2015/02/19 19:00:47
Done.
| |
54 virtual ~GPUTracer(); | 54 virtual ~GPUTracer(); |
55 | 55 |
56 // Scheduled processing in decoder begins. | 56 // Scheduled processing in decoder begins. |
57 bool BeginDecoding(); | 57 bool BeginDecoding(); |
58 | 58 |
59 // Scheduled processing in decoder ends. | 59 // Scheduled processing in decoder ends. |
60 bool EndDecoding(); | 60 bool EndDecoding(); |
61 | 61 |
62 // Begin a trace marker. | 62 // Begin a trace marker. |
63 bool Begin(const std::string& category, const std::string& name, | 63 bool Begin(const std::string& category, const std::string& name, |
(...skipping 19 matching lines...) Expand all Loading... | |
83 | 83 |
84 void IssueProcessTask(); | 84 void IssueProcessTask(); |
85 | 85 |
86 scoped_refptr<Outputter> outputter_; | 86 scoped_refptr<Outputter> outputter_; |
87 std::vector<TraceMarker> markers_[NUM_TRACER_SOURCES]; | 87 std::vector<TraceMarker> markers_[NUM_TRACER_SOURCES]; |
88 std::deque<scoped_refptr<GPUTrace> > traces_; | 88 std::deque<scoped_refptr<GPUTrace> > traces_; |
89 | 89 |
90 const unsigned char* gpu_trace_srv_category; | 90 const unsigned char* gpu_trace_srv_category; |
91 const unsigned char* gpu_trace_dev_category; | 91 const unsigned char* gpu_trace_dev_category; |
92 gles2::GLES2Decoder* decoder_; | 92 gles2::GLES2Decoder* decoder_; |
93 gpu::GPUTiming gpu_timing_; | 93 GPUTiming* gpu_timing_; |
94 scoped_refptr<DisjointContext> disjoint_context_; | |
94 | 95 |
95 bool gpu_executing_; | 96 bool gpu_executing_; |
96 bool process_posted_; | 97 bool process_posted_; |
97 | 98 |
98 private: | 99 private: |
99 DISALLOW_COPY_AND_ASSIGN(GPUTracer); | 100 DISALLOW_COPY_AND_ASSIGN(GPUTracer); |
100 }; | 101 }; |
101 | 102 |
102 class Outputter : public base::RefCounted<Outputter> { | 103 class Outputter : public base::RefCounted<Outputter> { |
103 public: | 104 public: |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 uint64 local_trace_id_; | 141 uint64 local_trace_id_; |
141 | 142 |
142 private: | 143 private: |
143 DISALLOW_COPY_AND_ASSIGN(TraceOutputter); | 144 DISALLOW_COPY_AND_ASSIGN(TraceOutputter); |
144 }; | 145 }; |
145 | 146 |
146 class GPU_EXPORT GPUTrace | 147 class GPU_EXPORT GPUTrace |
147 : public base::RefCounted<GPUTrace> { | 148 : public base::RefCounted<GPUTrace> { |
148 public: | 149 public: |
149 GPUTrace(scoped_refptr<Outputter> outputter, | 150 GPUTrace(scoped_refptr<Outputter> outputter, |
150 gpu::GPUTiming* gpu_timing, | 151 GPUTiming* gpu_timing, |
151 const std::string& category, | 152 const std::string& category, |
152 const std::string& name, | 153 const std::string& name, |
153 const bool enabled); | 154 const bool enabled); |
154 | 155 |
155 void Start(bool trace_service); | 156 void Start(bool trace_service); |
156 void End(bool tracing_service); | 157 void End(bool tracing_service); |
157 bool IsAvailable(); | 158 bool IsAvailable(); |
158 bool IsEnabled() { return enabled_; } | 159 bool IsEnabled() { return enabled_; } |
159 void Process(); | 160 void Process(); |
160 | 161 |
(...skipping 27 matching lines...) Expand all Loading... | |
188 | 189 |
189 private: | 190 private: |
190 GPUTracer* gpu_tracer_; | 191 GPUTracer* gpu_tracer_; |
191 GpuTracerSource source_; | 192 GpuTracerSource source_; |
192 }; | 193 }; |
193 | 194 |
194 } // namespace gles2 | 195 } // namespace gles2 |
195 } // namespace gpu | 196 } // namespace gpu |
196 | 197 |
197 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ | 198 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ |
OLD | NEW |