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

Unified Diff: cc/paint_time_counter.cc

Issue 12209022: cc: add rasterize time to continuous painting graph data in impl-side-painting (Closed) Base URL: http://git.chromium.org/chromium/src.git@raster
Patch Set: Created 7 years, 10 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/paint_time_counter.cc
diff --git a/cc/paint_time_counter.cc b/cc/paint_time_counter.cc
index 25b1bc677e9a7829cdf844a75d5c17588deeb5d4..14aa9cb569558aa7502932959c882aa77e9c2cda 100644
--- a/cc/paint_time_counter.cc
+++ b/cc/paint_time_counter.cc
@@ -11,7 +11,8 @@ scoped_ptr<PaintTimeCounter> PaintTimeCounter::create() {
return make_scoped_ptr(new PaintTimeCounter());
}
-PaintTimeCounter::PaintTimeCounter() {
+PaintTimeCounter::PaintTimeCounter()
+ : last_frame_number(-2) {
}
base::TimeDelta PaintTimeCounter::GetPaintTimeOfRecentFrame(
@@ -24,13 +25,15 @@ base::TimeDelta PaintTimeCounter::GetPaintTimeOfRecentFrame(
return base::TimeDelta();
}
-void PaintTimeCounter::SavePaintTime(const base::TimeDelta& total_paint_time) {
+void PaintTimeCounter::SavePaintTime(const base::TimeDelta& total_paint_time,
+ const int& frame_number) {
base::TimeDelta paint_time = total_paint_time - last_total_paint_time_;
- if (paint_time.InMillisecondsF() > 0)
+ if (paint_time.InMillisecondsF() > 0 && frame_number == last_frame_number + 1)
ring_buffer_.SaveToBuffer(paint_time);
last_total_paint_time_ = total_paint_time;
+ last_frame_number = frame_number;
}
void PaintTimeCounter::GetMinAndMaxPaintTime(base::TimeDelta* min,

Powered by Google App Engine
This is Rietveld 408576698