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

Side by Side Diff: cc/paint_time_counter.h

Issue 11827009: cc: add PaintTimeCounter to keep track of per frame paint time (Closed) Base URL: http://git.chromium.org/chromium/src.git@ring
Patch Set: updated to new RingBuffer Created 7 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_PAINT_TIME_COUNTER_H_
6 #define CC_PAINT_TIME_COUNTER_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "cc/ring_buffer.h"
11
12 namespace cc {
13
14 // Maintains a history of paint times for each frame in milliseconds
15 class PaintTimeCounter {
16 public:
17 static scoped_ptr<PaintTimeCounter> create();
18
19 size_t HistorySize() const { return ring_buffer_.BufferSize(); }
reveman 2013/01/11 16:10:49 nit: fix indent
20
21 // n = 0 returns the oldest and
22 // n = PaintTimeHistorySize() - 1 the most recent paint time.
23 double GetPaintTimeOfRecentFrame(int n) const;
reveman 2013/01/11 16:10:49 also here
24
25 void SavePaintTime(double total_paint_time);
26 void GetMinAndMaxPaintTime(double& min, double& max) const;
27
28 private:
29 PaintTimeCounter();
reveman 2013/01/11 16:10:49 and here
30
31 RingBuffer<double, 80> ring_buffer_;
reveman 2013/01/11 16:10:49 here
32 double last_paint_time_;
33
34 DISALLOW_COPY_AND_ASSIGN(PaintTimeCounter);
35 };
36
37 } // namespace cc
38
39 #endif // CC_PAINT_TIME_COUNTER_H_
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/paint_time_counter.cc » ('j') | cc/paint_time_counter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698