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 <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <deque> | 11 #include <deque> |
12 #include <memory> | 12 #include <memory> |
13 #include <stack> | 13 #include <stack> |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/memory/weak_ptr.h" | |
19 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
20 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 19 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
21 #include "gpu/gpu_export.h" | 20 #include "gpu/gpu_export.h" |
22 | 21 |
23 namespace gl { | 22 namespace gl { |
24 class GPUTimingClient; | 23 class GPUTimingClient; |
25 class GPUTimer; | 24 class GPUTimer; |
26 } | 25 } |
27 | 26 |
28 namespace gpu { | 27 namespace gpu { |
(...skipping 18 matching lines...) Expand all Loading... |
47 TraceMarker(const std::string& category, const std::string& name); | 46 TraceMarker(const std::string& category, const std::string& name); |
48 TraceMarker(const TraceMarker& other); | 47 TraceMarker(const TraceMarker& other); |
49 ~TraceMarker(); | 48 ~TraceMarker(); |
50 | 49 |
51 std::string category_; | 50 std::string category_; |
52 std::string name_; | 51 std::string name_; |
53 scoped_refptr<GPUTrace> trace_; | 52 scoped_refptr<GPUTrace> trace_; |
54 }; | 53 }; |
55 | 54 |
56 // Traces GPU Commands. | 55 // Traces GPU Commands. |
57 class GPU_EXPORT GPUTracer | 56 class GPU_EXPORT GPUTracer { |
58 : public base::SupportsWeakPtr<GPUTracer> { | |
59 public: | 57 public: |
60 explicit GPUTracer(gles2::GLES2Decoder* decoder); | 58 explicit GPUTracer(gles2::GLES2Decoder* decoder); |
61 virtual ~GPUTracer(); | 59 virtual ~GPUTracer(); |
62 | 60 |
63 void Destroy(bool have_context); | 61 void Destroy(bool have_context); |
64 | 62 |
65 // Scheduled processing in decoder begins. | 63 // Scheduled processing in decoder begins. |
66 bool BeginDecoding(); | 64 bool BeginDecoding(); |
67 | 65 |
68 // Scheduled processing in decoder ends. | 66 // Scheduled processing in decoder ends. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 212 |
215 private: | 213 private: |
216 GPUTracer* gpu_tracer_; | 214 GPUTracer* gpu_tracer_; |
217 GpuTracerSource source_; | 215 GpuTracerSource source_; |
218 }; | 216 }; |
219 | 217 |
220 } // namespace gles2 | 218 } // namespace gles2 |
221 } // namespace gpu | 219 } // namespace gpu |
222 | 220 |
223 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ | 221 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ |
OLD | NEW |