OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CC_DEBUG_RENDERING_STATS_H_ | 5 #ifndef CC_DEBUG_RENDERING_STATS_H_ |
6 #define CC_DEBUG_RENDERING_STATS_H_ | 6 #define CC_DEBUG_RENDERING_STATS_H_ |
7 | 7 |
8 #include <list> | |
9 | |
8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
9 #include "base/time/time.h" | 11 #include "base/time/time.h" |
10 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
11 #include "cc/debug/traced_value.h" | 13 #include "cc/debug/traced_value.h" |
12 | 14 |
13 namespace cc { | 15 namespace cc { |
14 | 16 |
15 struct CC_EXPORT MainThreadRenderingStats { | 17 struct CC_EXPORT MainThreadRenderingStats { |
16 // Note: when adding new members, please remember to update EnumerateFields | 18 // Note: when adding new members, please remember to update Add in |
17 // and Add in rendering_stats.cc. | 19 // rendering_stats.cc. |
18 | 20 |
19 int64 frame_count; | 21 int64 frame_count; |
20 base::TimeDelta paint_time; | 22 base::TimeDelta paint_time; |
21 int64 painted_pixel_count; | 23 int64 painted_pixel_count; |
22 base::TimeDelta record_time; | 24 base::TimeDelta record_time; |
23 int64 recorded_pixel_count; | 25 int64 recorded_pixel_count; |
24 | 26 |
25 MainThreadRenderingStats(); | 27 MainThreadRenderingStats(); |
28 ~MainThreadRenderingStats(); | |
26 scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceableData() const; | 29 scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceableData() const; |
27 void Add(const MainThreadRenderingStats& other); | 30 void Add(const MainThreadRenderingStats& other); |
28 }; | 31 }; |
29 | 32 |
33 // Stores a sequence of TimeDelta objects. | |
34 class CC_EXPORT TimeDeltaList { | |
danakj
2014/07/17 14:49:35
can this be a tested class inside ImplThreadRender
ernstm
2014/07/17 15:27:54
This should not be inside ImplThreadRenderingStats
danakj
2014/07/17 15:42:59
Oh, though it's not currently.
Technically this f
Dominik Grewe
2014/07/18 14:27:20
I've nested the classes inside RenderingStats and
| |
35 public: | |
36 TimeDeltaList(); | |
37 ~TimeDeltaList(); | |
38 | |
39 void Append(base::TimeDelta value); | |
40 scoped_ptr<base::ListValue> AsListValueInMilliseconds() const; | |
41 void Add(const TimeDeltaList& other); | |
42 | |
43 private: | |
44 std::list<base::TimeDelta> values; | |
45 }; | |
46 | |
30 struct CC_EXPORT ImplThreadRenderingStats { | 47 struct CC_EXPORT ImplThreadRenderingStats { |
31 // Note: when adding new members, please remember to update EnumerateFields | 48 // Note: when adding new members, please remember to update Add in |
32 // and Add in rendering_stats.cc. | 49 // rendering_stats.cc. |
33 | 50 |
34 int64 frame_count; | 51 int64 frame_count; |
35 base::TimeDelta rasterize_time; | 52 base::TimeDelta rasterize_time; |
36 base::TimeDelta analysis_time; | 53 base::TimeDelta analysis_time; |
37 int64 rasterized_pixel_count; | 54 int64 rasterized_pixel_count; |
38 int64 visible_content_area; | 55 int64 visible_content_area; |
39 int64 approximated_visible_content_area; | 56 int64 approximated_visible_content_area; |
40 | 57 |
58 TimeDeltaList draw_duration; | |
59 TimeDeltaList draw_duration_estimate; | |
60 TimeDeltaList begin_main_frame_to_commit_duration; | |
61 TimeDeltaList begin_main_frame_to_commit_duration_estimate; | |
62 TimeDeltaList commit_to_activate_duration; | |
63 TimeDeltaList commit_to_activate_duration_estimate; | |
64 | |
41 ImplThreadRenderingStats(); | 65 ImplThreadRenderingStats(); |
66 ~ImplThreadRenderingStats(); | |
42 scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceableData() const; | 67 scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceableData() const; |
43 void Add(const ImplThreadRenderingStats& other); | 68 void Add(const ImplThreadRenderingStats& other); |
44 }; | 69 }; |
45 | 70 |
46 struct CC_EXPORT RenderingStats { | 71 struct CC_EXPORT RenderingStats { |
47 MainThreadRenderingStats main_stats; | 72 MainThreadRenderingStats main_stats; |
48 ImplThreadRenderingStats impl_stats; | 73 ImplThreadRenderingStats impl_stats; |
49 | 74 |
50 // Add fields of |other| to the fields in this structure. | 75 // Add fields of |other| to the fields in this structure. |
51 void Add(const RenderingStats& other); | 76 void Add(const RenderingStats& other); |
52 }; | 77 }; |
53 | 78 |
54 } // namespace cc | 79 } // namespace cc |
55 | 80 |
56 #endif // CC_DEBUG_RENDERING_STATS_H_ | 81 #endif // CC_DEBUG_RENDERING_STATS_H_ |
OLD | NEW |