OLD | NEW |
| (Empty) |
1 // Copyright 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 #ifndef CC_DEBUG_RENDERING_STATS_H_ | |
6 #define CC_DEBUG_RENDERING_STATS_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/time/time.h" | |
12 #include "base/trace_event/trace_event_argument.h" | |
13 #include "base/values.h" | |
14 #include "cc/debug/traced_value.h" | |
15 | |
16 namespace cc { | |
17 | |
18 struct RenderingStats { | |
19 // Stores a sequence of TimeDelta objects. | |
20 class TimeDeltaList { | |
21 public: | |
22 TimeDeltaList(); | |
23 ~TimeDeltaList(); | |
24 | |
25 void Append(base::TimeDelta value); | |
26 void AddToTracedValue(const char* name, | |
27 base::trace_event::TracedValue* list_value) const; | |
28 | |
29 void Add(const TimeDeltaList& other); | |
30 | |
31 base::TimeDelta GetLastTimeDelta() const; | |
32 | |
33 private: | |
34 std::vector<base::TimeDelta> values; | |
35 }; | |
36 | |
37 RenderingStats(); | |
38 ~RenderingStats(); | |
39 | |
40 // Note: when adding new members, please remember to update Add in | |
41 // rendering_stats.cc. | |
42 | |
43 int64 frame_count; | |
44 int64 visible_content_area; | |
45 int64 approximated_visible_content_area; | |
46 | |
47 TimeDeltaList draw_duration; | |
48 TimeDeltaList draw_duration_estimate; | |
49 TimeDeltaList begin_main_frame_to_commit_duration; | |
50 TimeDeltaList begin_main_frame_to_commit_duration_estimate; | |
51 TimeDeltaList commit_to_activate_duration; | |
52 TimeDeltaList commit_to_activate_duration_estimate; | |
53 | |
54 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsTraceableData() | |
55 const; | |
56 void Add(const RenderingStats& other); | |
57 }; | |
58 | |
59 } // namespace cc | |
60 | |
61 #endif // CC_DEBUG_RENDERING_STATS_H_ | |
OLD | NEW |