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

Unified Diff: cc/debug/rendering_stats_instrumentation.cc

Issue 363003002: Add duration estimation data to RenderingStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check we only add duration data once per frame. Created 6 years, 6 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_instrumentation.cc
diff --git a/cc/debug/rendering_stats_instrumentation.cc b/cc/debug/rendering_stats_instrumentation.cc
index 9655241c63976bcb2cd688ee1826a1843d0d30f7..58a642dc87a2ca8e95c48f35fda1731393bfcb65 100644
--- a/cc/debug/rendering_stats_instrumentation.cc
+++ b/cc/debug/rendering_stats_instrumentation.cc
@@ -139,4 +139,56 @@ void RenderingStatsInstrumentation::AddApproximatedVisibleContentArea(
impl_thread_rendering_stats_.approximated_visible_content_area += area;
}
+void RenderingStatsInstrumentation::AddDrawDuration(
+ base::TimeDelta draw_duration,
+ base::TimeDelta draw_duration_estimate) {
+ if (!record_rendering_stats_)
+ return;
+
+ base::AutoLock scoped_lock(lock_);
+ // This should only be called once per frame.
+ DCHECK(impl_thread_rendering_stats_.draw_duration == base::TimeDelta());
Dominik Grewe 2014/07/02 14:43:22 I added these DCHECKS because I thought we'd only
brianderson 2014/07/02 22:39:29 I think it has to do with the various draw early o
Dominik Grewe 2014/07/03 13:16:38 I see. Thanks for the clarification!
+ DCHECK(impl_thread_rendering_stats_.draw_duration_estimate ==
+ base::TimeDelta());
+ impl_thread_rendering_stats_.draw_duration = draw_duration;
+ impl_thread_rendering_stats_.draw_duration_estimate = draw_duration_estimate;
+}
+
+void RenderingStatsInstrumentation::AddBeginMainFrameToCommitDuration(
+ base::TimeDelta begin_main_frame_to_commit_duration,
+ base::TimeDelta begin_main_frame_to_commit_duration_estimate) {
+ if (!record_rendering_stats_)
+ return;
+
+ base::AutoLock scoped_lock(lock_);
+ // This should only be called once per frame.
+ DCHECK(impl_thread_rendering_stats_.begin_main_frame_to_commit_duration ==
+ base::TimeDelta());
+ DCHECK(impl_thread_rendering_stats_
+ .begin_main_frame_to_commit_duration_estimate ==
+ base::TimeDelta());
+ impl_thread_rendering_stats_.begin_main_frame_to_commit_duration =
+ begin_main_frame_to_commit_duration;
+ impl_thread_rendering_stats_.begin_main_frame_to_commit_duration_estimate =
+ begin_main_frame_to_commit_duration_estimate;
+}
+
+void RenderingStatsInstrumentation::AddCommitToActivateDuration(
+ base::TimeDelta commit_to_activate_duration,
+ base::TimeDelta commit_to_activate_duration_estimate) {
+ if (!record_rendering_stats_)
+ return;
+
+ base::AutoLock scoped_lock(lock_);
+ // This should only be called once per frame.
+ DCHECK(impl_thread_rendering_stats_.commit_to_activate_duration ==
+ base::TimeDelta());
+ DCHECK(impl_thread_rendering_stats_.commit_to_activate_duration_estimate ==
+ base::TimeDelta());
+ impl_thread_rendering_stats_.commit_to_activate_duration =
+ commit_to_activate_duration;
+ impl_thread_rendering_stats_.commit_to_activate_duration_estimate =
+ commit_to_activate_duration_estimate;
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698