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 "base/values.h" | 5 #include "base/values.h" |
6 #include "cc/debug/rendering_stats.h" | 6 #include "cc/debug/rendering_stats.h" |
7 | 7 |
8 namespace cc { | 8 namespace cc { |
9 | 9 |
10 MainThreadRenderingStats::MainThreadRenderingStats() | 10 MainThreadRenderingStats::MainThreadRenderingStats() |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 void RenderingStats::EnumerateFields(Enumerator* enumerator) const { | 31 void RenderingStats::EnumerateFields(Enumerator* enumerator) const { |
32 enumerator->AddInt64("numAnimationFrames", | 32 enumerator->AddInt64("numAnimationFrames", |
33 main_stats.animation_frame_count); | 33 main_stats.animation_frame_count); |
34 enumerator->AddInt64("numFramesSentToScreen", main_stats.screen_frame_count + | 34 enumerator->AddInt64("numFramesSentToScreen", main_stats.screen_frame_count + |
35 impl_stats.screen_frame_count); | 35 impl_stats.screen_frame_count); |
36 enumerator->AddDouble("totalPaintTimeInSeconds", | 36 enumerator->AddDouble("totalPaintTimeInSeconds", |
37 main_stats.paint_time.InSecondsF()); | 37 main_stats.paint_time.InSecondsF()); |
38 enumerator->AddDouble("totalRecordTimeInSeconds", | 38 enumerator->AddDouble("totalRecordTimeInSeconds", |
39 main_stats.record_time.InSecondsF()); | 39 main_stats.record_time.InSecondsF()); |
| 40 enumerator->AddDouble("totalBestRecordTimeInSeconds", |
| 41 main_stats.best_record_time.InSecondsF()); |
40 enumerator->AddDouble("totalCommitTimeInSeconds", | 42 enumerator->AddDouble("totalCommitTimeInSeconds", |
41 main_stats.commit_time.InSecondsF()); | 43 main_stats.commit_time.InSecondsF()); |
42 enumerator->AddInt64("totalCommitCount", main_stats.commit_count); | 44 enumerator->AddInt64("totalCommitCount", main_stats.commit_count); |
43 enumerator->AddInt64("totalPixelsPainted", main_stats.painted_pixel_count); | 45 enumerator->AddInt64("totalPixelsPainted", main_stats.painted_pixel_count); |
44 enumerator->AddInt64("totalPixelsRecorded", main_stats.recorded_pixel_count); | 46 enumerator->AddInt64("totalPixelsRecorded", main_stats.recorded_pixel_count); |
45 enumerator->AddInt64("totalImageGatheringCount", | 47 enumerator->AddInt64("totalImageGatheringCount", |
46 main_stats.image_gathering_count); | 48 main_stats.image_gathering_count); |
47 enumerator->AddDouble("totalImageGatheringTimeInSeconds", | 49 enumerator->AddDouble("totalImageGatheringTimeInSeconds", |
48 main_stats.image_gathering_time.InSecondsF()); | 50 main_stats.image_gathering_time.InSecondsF()); |
49 enumerator->AddInt64("droppedFrameCount", impl_stats.dropped_frame_count); | 51 enumerator->AddInt64("droppedFrameCount", impl_stats.dropped_frame_count); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 MainThreadRenderingStats::AsTraceableData() const { | 88 MainThreadRenderingStats::AsTraceableData() const { |
87 scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue()); | 89 scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue()); |
88 record_data->SetInteger("animation_frame_count", | 90 record_data->SetInteger("animation_frame_count", |
89 animation_frame_count); | 91 animation_frame_count); |
90 record_data->SetInteger("screen_frame_count", | 92 record_data->SetInteger("screen_frame_count", |
91 screen_frame_count); | 93 screen_frame_count); |
92 record_data->SetDouble("paint_time", | 94 record_data->SetDouble("paint_time", |
93 paint_time.InSecondsF()); | 95 paint_time.InSecondsF()); |
94 record_data->SetDouble("record_time", | 96 record_data->SetDouble("record_time", |
95 record_time.InSecondsF()); | 97 record_time.InSecondsF()); |
| 98 record_data->SetDouble("best_record_time", |
| 99 best_record_time.InSecondsF()); |
96 record_data->SetDouble("commit_time", | 100 record_data->SetDouble("commit_time", |
97 commit_time.InSecondsF()); | 101 commit_time.InSecondsF()); |
98 record_data->SetInteger("commit_count", | 102 record_data->SetInteger("commit_count", |
99 commit_count); | 103 commit_count); |
100 record_data->SetInteger("painted_pixel_count", | 104 record_data->SetInteger("painted_pixel_count", |
101 painted_pixel_count); | 105 painted_pixel_count); |
102 record_data->SetInteger("recorded_pixel_count", | 106 record_data->SetInteger("recorded_pixel_count", |
103 recorded_pixel_count); | 107 recorded_pixel_count); |
104 record_data->SetInteger("image_gathering_count", | 108 record_data->SetInteger("image_gathering_count", |
105 image_gathering_count); | 109 image_gathering_count); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 tile_analysis_time.InSecondsF()); | 157 tile_analysis_time.InSecondsF()); |
154 return TracedValue::FromValue(record_data.release()); | 158 return TracedValue::FromValue(record_data.release()); |
155 } | 159 } |
156 | 160 |
157 | 161 |
158 void MainThreadRenderingStats::Add(const MainThreadRenderingStats& other) { | 162 void MainThreadRenderingStats::Add(const MainThreadRenderingStats& other) { |
159 animation_frame_count += other.animation_frame_count; | 163 animation_frame_count += other.animation_frame_count; |
160 screen_frame_count += other.screen_frame_count; | 164 screen_frame_count += other.screen_frame_count; |
161 paint_time += other.paint_time; | 165 paint_time += other.paint_time; |
162 record_time += other.record_time; | 166 record_time += other.record_time; |
| 167 best_record_time += other.best_record_time; |
163 commit_time += other.commit_time; | 168 commit_time += other.commit_time; |
164 commit_count += other.commit_count; | 169 commit_count += other.commit_count; |
165 painted_pixel_count += other.painted_pixel_count; | 170 painted_pixel_count += other.painted_pixel_count; |
166 recorded_pixel_count += other.recorded_pixel_count; | 171 recorded_pixel_count += other.recorded_pixel_count; |
167 image_gathering_count += other.image_gathering_count; | 172 image_gathering_count += other.image_gathering_count; |
168 image_gathering_time += other.image_gathering_time; | 173 image_gathering_time += other.image_gathering_time; |
169 } | 174 } |
170 | 175 |
171 void ImplThreadRenderingStats::Add(const ImplThreadRenderingStats& other) { | 176 void ImplThreadRenderingStats::Add(const ImplThreadRenderingStats& other) { |
172 screen_frame_count += other.screen_frame_count; | 177 screen_frame_count += other.screen_frame_count; |
(...skipping 14 matching lines...) Expand all Loading... |
187 solid_color_tile_analysis_count += other.solid_color_tile_analysis_count; | 192 solid_color_tile_analysis_count += other.solid_color_tile_analysis_count; |
188 tile_analysis_time += other.tile_analysis_time; | 193 tile_analysis_time += other.tile_analysis_time; |
189 } | 194 } |
190 | 195 |
191 void RenderingStats::Add(const RenderingStats& other) { | 196 void RenderingStats::Add(const RenderingStats& other) { |
192 main_stats.Add(other.main_stats); | 197 main_stats.Add(other.main_stats); |
193 impl_stats.Add(other.impl_stats); | 198 impl_stats.Add(other.impl_stats); |
194 } | 199 } |
195 | 200 |
196 } // namespace cc | 201 } // namespace cc |
OLD | NEW |