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

Unified Diff: cc/paint_time_counter.h

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: Save paint and rasterize time in per frame struct 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.h
diff --git a/cc/paint_time_counter.h b/cc/paint_time_counter.h
index d79db69e675dd1dd1353cc39dfd65f37beeb0a89..c99913202d6a0502db4aa949e0ca2bfcb92d30e1 100644
--- a/cc/paint_time_counter.h
+++ b/cc/paint_time_counter.h
@@ -19,18 +19,43 @@ class PaintTimeCounter {
size_t HistorySize() const { return ring_buffer_.BufferSize(); }
+ struct Entry {
+ Entry()
+ : frame_number(0) { }
+
+ int frame_number;
+ base::TimeDelta paint_time;
+ base::TimeDelta rasterize_time;
+
+ base::TimeDelta time() const {
+ return paint_time + rasterize_time;
+ }
+ };
+
// n = 0 returns the oldest and
// n = PaintTimeHistorySize() - 1 the most recent paint time.
base::TimeDelta GetPaintTimeOfRecentFrame(const size_t& n) const;
- void SavePaintTime(const base::TimeDelta& total_paint_time);
+ void SavePaintTime(const base::TimeDelta& total_paint_time,
+ const int& frame_number);
+ void SaveRasterizeTime(const base::TimeDelta& total_rasterize_time,
+ const int& frame_number);
void GetMinAndMaxPaintTime(base::TimeDelta* min, base::TimeDelta* max) const;
+ void ClearHistory();
+
private:
PaintTimeCounter();
- RingBuffer<base::TimeDelta, 90> ring_buffer_;
+ Entry& GetEntryForFrame(const int& frame_number);
+
+ RingBuffer<Entry, 90> ring_buffer_;
+
base::TimeDelta last_total_paint_time_;
+ base::TimeDelta last_total_rasterize_time_;
+
+ bool ignore_next_paint_time_;
+ bool ignore_next_rasterize_time_;
DISALLOW_COPY_AND_ASSIGN(PaintTimeCounter);
};

Powered by Google App Engine
This is Rietveld 408576698