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 #include "cc/debug/rendering_stats.h" | 5 #include "cc/debug/rendering_stats.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 RenderingStats::TimeDeltaList::TimeDeltaList() { | 9 RenderingStats::TimeDeltaList::TimeDeltaList() { |
10 } | 10 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void RenderingStats::MainThreadRenderingStats::Add( | 49 void RenderingStats::MainThreadRenderingStats::Add( |
50 const MainThreadRenderingStats& other) { | 50 const MainThreadRenderingStats& other) { |
51 paint_time += other.paint_time; | 51 paint_time += other.paint_time; |
52 painted_pixel_count += other.painted_pixel_count; | 52 painted_pixel_count += other.painted_pixel_count; |
53 record_time += other.record_time; | 53 record_time += other.record_time; |
54 recorded_pixel_count += other.recorded_pixel_count; | 54 recorded_pixel_count += other.recorded_pixel_count; |
55 } | 55 } |
56 | 56 |
57 RenderingStats::ImplThreadRenderingStats::ImplThreadRenderingStats() | 57 RenderingStats::ImplThreadRenderingStats::ImplThreadRenderingStats() |
58 : frame_count(0), | 58 : frame_count(0), |
59 rasterized_pixel_count(0), | |
60 visible_content_area(0), | 59 visible_content_area(0), |
61 approximated_visible_content_area(0) { | 60 approximated_visible_content_area(0) { |
62 } | 61 } |
63 | 62 |
64 RenderingStats::ImplThreadRenderingStats::~ImplThreadRenderingStats() { | 63 RenderingStats::ImplThreadRenderingStats::~ImplThreadRenderingStats() { |
65 } | 64 } |
66 | 65 |
67 scoped_refptr<base::debug::ConvertableToTraceFormat> | 66 scoped_refptr<base::debug::ConvertableToTraceFormat> |
68 RenderingStats::ImplThreadRenderingStats::AsTraceableData() const { | 67 RenderingStats::ImplThreadRenderingStats::AsTraceableData() const { |
69 scoped_refptr<base::debug::TracedValue> record_data = | 68 scoped_refptr<base::debug::TracedValue> record_data = |
70 new base::debug::TracedValue(); | 69 new base::debug::TracedValue(); |
71 record_data->SetInteger("frame_count", frame_count); | 70 record_data->SetInteger("frame_count", frame_count); |
72 record_data->SetDouble("rasterize_time", rasterize_time.InSecondsF()); | |
73 record_data->SetInteger("rasterized_pixel_count", rasterized_pixel_count); | |
74 record_data->SetInteger("visible_content_area", visible_content_area); | 71 record_data->SetInteger("visible_content_area", visible_content_area); |
75 record_data->SetInteger("approximated_visible_content_area", | 72 record_data->SetInteger("approximated_visible_content_area", |
76 approximated_visible_content_area); | 73 approximated_visible_content_area); |
77 record_data->BeginArray("draw_duration_ms"); | 74 record_data->BeginArray("draw_duration_ms"); |
78 draw_duration.AddToTracedValue(record_data.get()); | 75 draw_duration.AddToTracedValue(record_data.get()); |
79 record_data->EndArray(); | 76 record_data->EndArray(); |
80 | 77 |
81 record_data->BeginArray("draw_duration_estimate_ms"); | 78 record_data->BeginArray("draw_duration_estimate_ms"); |
82 draw_duration_estimate.AddToTracedValue(record_data.get()); | 79 draw_duration_estimate.AddToTracedValue(record_data.get()); |
83 record_data->EndArray(); | 80 record_data->EndArray(); |
(...skipping 13 matching lines...) Expand all Loading... |
97 | 94 |
98 record_data->BeginArray("commit_to_activate_duration_estimate_ms"); | 95 record_data->BeginArray("commit_to_activate_duration_estimate_ms"); |
99 commit_to_activate_duration_estimate.AddToTracedValue(record_data.get()); | 96 commit_to_activate_duration_estimate.AddToTracedValue(record_data.get()); |
100 record_data->EndArray(); | 97 record_data->EndArray(); |
101 return record_data; | 98 return record_data; |
102 } | 99 } |
103 | 100 |
104 void RenderingStats::ImplThreadRenderingStats::Add( | 101 void RenderingStats::ImplThreadRenderingStats::Add( |
105 const ImplThreadRenderingStats& other) { | 102 const ImplThreadRenderingStats& other) { |
106 frame_count += other.frame_count; | 103 frame_count += other.frame_count; |
107 rasterize_time += other.rasterize_time; | |
108 analysis_time += other.analysis_time; | |
109 rasterized_pixel_count += other.rasterized_pixel_count; | |
110 visible_content_area += other.visible_content_area; | 104 visible_content_area += other.visible_content_area; |
111 approximated_visible_content_area += other.approximated_visible_content_area; | 105 approximated_visible_content_area += other.approximated_visible_content_area; |
112 | 106 |
113 draw_duration.Add(other.draw_duration); | 107 draw_duration.Add(other.draw_duration); |
114 draw_duration_estimate.Add(other.draw_duration_estimate); | 108 draw_duration_estimate.Add(other.draw_duration_estimate); |
115 begin_main_frame_to_commit_duration.Add( | 109 begin_main_frame_to_commit_duration.Add( |
116 other.begin_main_frame_to_commit_duration); | 110 other.begin_main_frame_to_commit_duration); |
117 begin_main_frame_to_commit_duration_estimate.Add( | 111 begin_main_frame_to_commit_duration_estimate.Add( |
118 other.begin_main_frame_to_commit_duration_estimate); | 112 other.begin_main_frame_to_commit_duration_estimate); |
119 commit_to_activate_duration.Add(other.commit_to_activate_duration); | 113 commit_to_activate_duration.Add(other.commit_to_activate_duration); |
120 commit_to_activate_duration_estimate.Add( | 114 commit_to_activate_duration_estimate.Add( |
121 other.commit_to_activate_duration_estimate); | 115 other.commit_to_activate_duration_estimate); |
122 } | 116 } |
123 | 117 |
124 void RenderingStats::Add(const RenderingStats& other) { | 118 void RenderingStats::Add(const RenderingStats& other) { |
125 main_stats.Add(other.main_stats); | 119 main_stats.Add(other.main_stats); |
126 impl_stats.Add(other.impl_stats); | 120 impl_stats.Add(other.impl_stats); |
127 } | 121 } |
128 | 122 |
129 } // namespace cc | 123 } // namespace cc |
OLD | NEW |