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

Side by Side Diff: cc/debug/paint_time_counter.h

Issue 1535833002: Delete CC. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-5
Patch Set: rebase Created 4 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
« no previous file with comments | « cc/debug/lap_timer.cc ('k') | cc/debug/paint_time_counter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_DEBUG_PAINT_TIME_COUNTER_H_
6 #define CC_DEBUG_PAINT_TIME_COUNTER_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/time/time.h"
11 #include "cc/debug/ring_buffer.h"
12
13 namespace cc {
14
15 // Maintains a history of paint times for each frame
16 class PaintTimeCounter {
17 public:
18 static scoped_ptr<PaintTimeCounter> Create();
19
20 size_t HistorySize() const { return ring_buffer_.BufferSize(); }
21
22 // n = 0 returns the oldest and
23 // n = PaintTimeHistorySize() - 1 the most recent paint time.
24 base::TimeDelta GetPaintTimeOfRecentFrame(const size_t& n) const;
25
26 void SavePaintTime(const base::TimeDelta& total_paint_time);
27 void GetMinAndMaxPaintTime(base::TimeDelta* min, base::TimeDelta* max) const;
28
29 void ClearHistory();
30
31 typedef RingBuffer<base::TimeDelta, 200> RingBufferType;
32 RingBufferType::Iterator Begin() const { return ring_buffer_.Begin(); }
33 RingBufferType::Iterator End() const { return ring_buffer_.End(); }
34
35 private:
36 PaintTimeCounter();
37
38 RingBufferType ring_buffer_;
39
40 DISALLOW_COPY_AND_ASSIGN(PaintTimeCounter);
41 };
42
43 } // namespace cc
44
45 #endif // CC_DEBUG_PAINT_TIME_COUNTER_H_
OLDNEW
« no previous file with comments | « cc/debug/lap_timer.cc ('k') | cc/debug/paint_time_counter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698