Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1907)

Unified Diff: cc/debug/rendering_stats.cc

Issue 363003002: Add duration estimation data to RenderingStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: LTHI forwards estimates to rendering stats. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/debug/rendering_stats.cc
diff --git a/cc/debug/rendering_stats.cc b/cc/debug/rendering_stats.cc
index 3e123b667c774656f88f421225e5f1963ad64f69..ba39a0791577fd1b19429d918879fe1f0858a555 100644
--- a/cc/debug/rendering_stats.cc
+++ b/cc/debug/rendering_stats.cc
@@ -31,6 +31,25 @@ void MainThreadRenderingStats::Add(const MainThreadRenderingStats& other) {
recorded_pixel_count += other.recorded_pixel_count;
}
+void ImplThreadRenderingStatsAccumulated::Append(base::TimeDelta value) {
+ values.push_back(value);
+}
+
+scoped_ptr<base::Value>
+ImplThreadRenderingStatsAccumulated::AsValueInMilliseconds() const {
ernstm 2014/07/14 13:12:39 The method name is a bit misleading. The return va
Dominik Grewe 2014/07/14 13:37:52 Done.
+ scoped_ptr<base::ListValue> list_value(new base::ListValue);
+ std::list<base::TimeDelta>::const_iterator iter;
+ for (iter = values.begin(); iter != values.end(); ++iter) {
+ list_value->AppendDouble(iter->InMillisecondsF());
+ }
+ return list_value.PassAs<base::Value>();
+}
+
+void ImplThreadRenderingStatsAccumulated::Add(
+ const ImplThreadRenderingStatsAccumulated& other) {
+ values.insert(values.end(), other.values.begin(), other.values.end());
+}
+
ImplThreadRenderingStats::ImplThreadRenderingStats()
: frame_count(0),
rasterized_pixel_count(0),
@@ -47,6 +66,23 @@ ImplThreadRenderingStats::AsTraceableData() const {
record_data->SetInteger("visible_content_area", visible_content_area);
record_data->SetInteger("approximated_visible_content_area",
approximated_visible_content_area);
+ record_data->Set("draw_duration_ms",
+ draw_duration.AsValueInMilliseconds().release());
+ record_data->Set("draw_duration_estimate_ms",
+ draw_duration_estimate.AsValueInMilliseconds().release());
+ record_data->Set(
+ "begin_main_frame_to_commit_duration_ms",
+ begin_main_frame_to_commit_duration.AsValueInMilliseconds().release());
+ record_data->Set(
+ "begin_main_frame_to_commit_duration_estimate_ms",
+ begin_main_frame_to_commit_duration_estimate.AsValueInMilliseconds()
+ .release());
+ record_data->Set(
+ "commit_to_activate_duration_ms",
+ commit_to_activate_duration.AsValueInMilliseconds().release());
+ record_data->Set(
+ "commit_to_activate_duration_estimate_ms",
+ commit_to_activate_duration_estimate.AsValueInMilliseconds().release());
return TracedValue::FromValue(record_data.release());
}
@@ -57,6 +93,16 @@ void ImplThreadRenderingStats::Add(const ImplThreadRenderingStats& other) {
rasterized_pixel_count += other.rasterized_pixel_count;
visible_content_area += other.visible_content_area;
approximated_visible_content_area += other.approximated_visible_content_area;
+
+ draw_duration.Add(other.draw_duration);
+ draw_duration_estimate.Add(other.draw_duration_estimate);
+ begin_main_frame_to_commit_duration.Add(
+ other.begin_main_frame_to_commit_duration);
+ begin_main_frame_to_commit_duration_estimate.Add(
+ other.begin_main_frame_to_commit_duration_estimate);
+ commit_to_activate_duration.Add(other.commit_to_activate_duration);
+ commit_to_activate_duration_estimate.Add(
+ other.commit_to_activate_duration_estimate);
}
void RenderingStats::Add(const RenderingStats& other) {

Powered by Google App Engine
This is Rietveld 408576698