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.
5 #include "cc/debug/paint_time_counter.h"
10 scoped_ptr
<PaintTimeCounter
> PaintTimeCounter::Create() {
11 return make_scoped_ptr(new PaintTimeCounter());
14 PaintTimeCounter::PaintTimeCounter() {
17 void PaintTimeCounter::SavePaintTime(const base::TimeDelta
& paint_time
) {
18 ring_buffer_
.SaveToBuffer(paint_time
);
21 void PaintTimeCounter::GetMinAndMaxPaintTime(base::TimeDelta
* min
,
22 base::TimeDelta
* max
) const {
23 *min
= base::TimeDelta::FromDays(1);
24 *max
= base::TimeDelta();
26 for (RingBufferType::Iterator it
= ring_buffer_
.Begin(); it
; ++it
) {
27 const base::TimeDelta paint_time
= **it
;
29 if (paint_time
< *min
)
31 if (paint_time
> *max
)
39 void PaintTimeCounter::ClearHistory() {