OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 // This file contains the GPUTrace class. | |
6 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ | |
7 #define GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ | |
8 | |
9 #include <deque> | |
10 #include <stack> | |
11 #include <string> | |
12 | |
13 #include "base/basictypes.h" | |
14 #include "base/memory/linked_ptr.h" | |
15 #include "base/memory/scoped_ptr.h" | |
16 | |
17 namespace gpu { | |
18 namespace gles2 { | |
19 | |
20 // Traces GPU Commands. | |
21 class GPUTracer { | |
22 public: | |
23 class Outputter; | |
24 class Trace; | |
25 | |
26 static scoped_ptr<GPUTracer> create(); | |
jonathan.backer
2012/11/23 18:55:41
nit: Create()
I think that we only use C style fo
dsinclair
2012/11/23 21:13:56
Done.
| |
27 | |
28 virtual ~GPUTracer(); | |
29 | |
30 // Begin a trace. | |
31 bool Begin(const std::string& name); | |
jonathan.backer
2012/11/23 18:55:41
This is good. But eventually you'll want an interf
dsinclair
2012/11/23 21:13:56
Done.
| |
32 | |
33 // End the last started trace. | |
34 bool End(); | |
35 | |
36 // Process any completed traces. | |
37 void Process(); | |
38 | |
39 protected: | |
40 GPUTracer(); | |
41 | |
42 // Create a new trace. | |
43 virtual linked_ptr<GPUTracer::Trace> CreateTrace(const std::string& name) = 0; | |
44 | |
45 linked_ptr<GPUTracer::Outputter> output_; | |
46 | |
47 private: | |
48 linked_ptr<Trace> current_trace_; | |
49 std::deque<linked_ptr<Trace> > traces_; | |
50 | |
51 DISALLOW_COPY_AND_ASSIGN(GPUTracer); | |
52 }; | |
53 | |
54 } // namespace gles2 | |
55 } // namespace gpu | |
56 | |
57 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_ | |
OLD | NEW |