Chromium Code Reviews| 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 |