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 EnumerateFields |
17 // and Add in rendering_stats.cc. | 19 // and Add in 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(); |
26 scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceableData() const; | 28 scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceableData() const; |
27 void Add(const MainThreadRenderingStats& other); | 29 void Add(const MainThreadRenderingStats& other); |
28 }; | 30 }; |
29 | 31 |
32 // Stores a sequence of TimeDelta objects. | |
33 class CC_EXPORT ImplThreadRenderingStatsAccumulated { | |
ernstm
2014/07/14 13:12:39
If we expect to use more of these list values in t
Dominik Grewe
2014/07/14 13:37:52
Good point. Done.
| |
34 public: | |
35 void Append(base::TimeDelta value); | |
36 scoped_ptr<base::Value> AsValueInMilliseconds() const; | |
37 void Add(const ImplThreadRenderingStatsAccumulated& other); | |
38 | |
39 private: | |
40 std::list<base::TimeDelta> values; | |
41 }; | |
42 | |
30 struct CC_EXPORT ImplThreadRenderingStats { | 43 struct CC_EXPORT ImplThreadRenderingStats { |
31 // Note: when adding new members, please remember to update EnumerateFields | 44 // Note: when adding new members, please remember to update EnumerateFields |
32 // and Add in rendering_stats.cc. | 45 // and Add in rendering_stats.cc. |
33 | 46 |
34 int64 frame_count; | 47 int64 frame_count; |
35 base::TimeDelta rasterize_time; | 48 base::TimeDelta rasterize_time; |
36 base::TimeDelta analysis_time; | 49 base::TimeDelta analysis_time; |
37 int64 rasterized_pixel_count; | 50 int64 rasterized_pixel_count; |
38 int64 visible_content_area; | 51 int64 visible_content_area; |
39 int64 approximated_visible_content_area; | 52 int64 approximated_visible_content_area; |
40 | 53 |
54 ImplThreadRenderingStatsAccumulated draw_duration; | |
55 ImplThreadRenderingStatsAccumulated draw_duration_estimate; | |
56 ImplThreadRenderingStatsAccumulated begin_main_frame_to_commit_duration; | |
57 ImplThreadRenderingStatsAccumulated | |
58 begin_main_frame_to_commit_duration_estimate; | |
59 ImplThreadRenderingStatsAccumulated commit_to_activate_duration; | |
60 ImplThreadRenderingStatsAccumulated commit_to_activate_duration_estimate; | |
61 | |
41 ImplThreadRenderingStats(); | 62 ImplThreadRenderingStats(); |
42 scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceableData() const; | 63 scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceableData() const; |
43 void Add(const ImplThreadRenderingStats& other); | 64 void Add(const ImplThreadRenderingStats& other); |
44 }; | 65 }; |
45 | 66 |
46 struct CC_EXPORT RenderingStats { | 67 struct CC_EXPORT RenderingStats { |
47 MainThreadRenderingStats main_stats; | 68 MainThreadRenderingStats main_stats; |
48 ImplThreadRenderingStats impl_stats; | 69 ImplThreadRenderingStats impl_stats; |
49 | 70 |
50 // Add fields of |other| to the fields in this structure. | 71 // Add fields of |other| to the fields in this structure. |
51 void Add(const RenderingStats& other); | 72 void Add(const RenderingStats& other); |
52 }; | 73 }; |
53 | 74 |
54 } // namespace cc | 75 } // namespace cc |
55 | 76 |
56 #endif // CC_DEBUG_RENDERING_STATS_H_ | 77 #endif // CC_DEBUG_RENDERING_STATS_H_ |
OLD | NEW |