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

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: add CC_EXPORT 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
« no previous file with comments | « cc/debug/rendering_stats_instrumentation.h ('k') | cc/debug/rendering_stats_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..01499d26ae3f043367190ead0675c90cef578042 100644
--- a/cc/debug/rendering_stats_instrumentation.cc
+++ b/cc/debug/rendering_stats_instrumentation.cc
@@ -18,13 +18,13 @@ RenderingStatsInstrumentation::RenderingStatsInstrumentation()
RenderingStatsInstrumentation::~RenderingStatsInstrumentation() {}
-MainThreadRenderingStats
+RenderingStats::MainThreadRenderingStats
RenderingStatsInstrumentation::main_thread_rendering_stats() {
base::AutoLock scoped_lock(lock_);
return main_thread_rendering_stats_;
}
-ImplThreadRenderingStats
+RenderingStats::ImplThreadRenderingStats
RenderingStatsInstrumentation::impl_thread_rendering_stats() {
base::AutoLock scoped_lock(lock_);
return impl_thread_rendering_stats_;
@@ -43,13 +43,13 @@ RenderingStats RenderingStatsInstrumentation::GetRenderingStats() {
void RenderingStatsInstrumentation::AccumulateAndClearMainThreadStats() {
base::AutoLock scoped_lock(lock_);
main_thread_rendering_stats_accu_.Add(main_thread_rendering_stats_);
- main_thread_rendering_stats_ = MainThreadRenderingStats();
+ main_thread_rendering_stats_ = RenderingStats::MainThreadRenderingStats();
}
void RenderingStatsInstrumentation::AccumulateAndClearImplThreadStats() {
base::AutoLock scoped_lock(lock_);
impl_thread_rendering_stats_accu_.Add(impl_thread_rendering_stats_);
- impl_thread_rendering_stats_ = ImplThreadRenderingStats();
+ impl_thread_rendering_stats_ = RenderingStats::ImplThreadRenderingStats();
}
base::TimeTicks RenderingStatsInstrumentation::StartRecording() const {
@@ -139,4 +139,42 @@ 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_);
+ impl_thread_rendering_stats_.draw_duration.Append(draw_duration);
+ impl_thread_rendering_stats_.draw_duration_estimate.Append(
+ 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_);
+ impl_thread_rendering_stats_.begin_main_frame_to_commit_duration.Append(
+ begin_main_frame_to_commit_duration);
+ impl_thread_rendering_stats_.begin_main_frame_to_commit_duration_estimate
+ .Append(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_);
+ impl_thread_rendering_stats_.commit_to_activate_duration.Append(
+ commit_to_activate_duration);
+ impl_thread_rendering_stats_.commit_to_activate_duration_estimate.Append(
+ commit_to_activate_duration_estimate);
+}
+
} // namespace cc
« no previous file with comments | « cc/debug/rendering_stats_instrumentation.h ('k') | cc/debug/rendering_stats_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698