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

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

Issue 1533773002: Delete CC. (Closed) Base URL: git@github.com:domokit/mojo.git@cl-2e
Patch Set: rebase Created 5 years 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/paint_time_counter.h ('k') | cc/debug/rendering_stats.h » ('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 2012 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 #include "cc/debug/paint_time_counter.h"
6
7 namespace cc {
8
9 // static
10 scoped_ptr<PaintTimeCounter> PaintTimeCounter::Create() {
11 return make_scoped_ptr(new PaintTimeCounter());
12 }
13
14 PaintTimeCounter::PaintTimeCounter() {
15 }
16
17 void PaintTimeCounter::SavePaintTime(const base::TimeDelta& paint_time) {
18 ring_buffer_.SaveToBuffer(paint_time);
19 }
20
21 void PaintTimeCounter::GetMinAndMaxPaintTime(base::TimeDelta* min,
22 base::TimeDelta* max) const {
23 *min = base::TimeDelta::FromDays(1);
24 *max = base::TimeDelta();
25
26 for (RingBufferType::Iterator it = ring_buffer_.Begin(); it; ++it) {
27 const base::TimeDelta paint_time = **it;
28
29 if (paint_time < *min)
30 *min = paint_time;
31 if (paint_time > *max)
32 *max = paint_time;
33 }
34
35 if (*min > *max)
36 *min = *max;
37 }
38
39 void PaintTimeCounter::ClearHistory() {
40 ring_buffer_.Clear();
41 }
42
43 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/paint_time_counter.h ('k') | cc/debug/rendering_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698