OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/frame_rate_counter.h" | 5 #include "cc/frame_rate_counter.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "cc/proxy.h" | 10 #include "cc/proxy.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 void FrameRateCounter::saveTimeStamp(base::TimeTicks timestamp) | 35 void FrameRateCounter::saveTimeStamp(base::TimeTicks timestamp) |
36 { | 36 { |
37 m_ringBuffer.SaveToBuffer(timestamp); | 37 m_ringBuffer.SaveToBuffer(timestamp); |
38 | 38 |
39 // Check if frame interval can be computed. | 39 // Check if frame interval can be computed. |
40 if (m_ringBuffer.CurrentIndex() < 2) | 40 if (m_ringBuffer.CurrentIndex() < 2) |
41 return; | 41 return; |
42 | 42 |
43 base::TimeDelta frameIntervalSeconds = recentFrameInterval(m_ringBuffer.Buff
erSize() - 1); | 43 base::TimeDelta frameIntervalSeconds = recentFrameInterval(m_ringBuffer.Buff
erSize() - 1); |
44 | 44 |
45 if (m_hasImplThread && m_ringBuffer.CurrentIndex() > 0) | 45 if (m_hasImplThread && m_ringBuffer.CurrentIndex() > 0) { |
46 HISTOGRAM_CUSTOM_COUNTS("Renderer4.CompositorThreadImplDrawDelay", frame
IntervalSeconds.InMilliseconds(), 1, 120, 60); | 46 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.CompositorThreadImplDrawDelay", |
| 47 frameIntervalSeconds.InMilliseconds(), |
| 48 1, 120, 60); |
| 49 } |
47 | 50 |
48 if (!isBadFrameInterval(frameIntervalSeconds) && | 51 if (!isBadFrameInterval(frameIntervalSeconds) && |
49 frameIntervalSeconds.InSecondsF() > kDroppedFrameTime) | 52 frameIntervalSeconds.InSecondsF() > kDroppedFrameTime) |
50 ++m_droppedFrameCount; | 53 ++m_droppedFrameCount; |
51 } | 54 } |
52 | 55 |
53 bool FrameRateCounter::isBadFrameInterval(base::TimeDelta intervalBetweenConsecu
tiveFrames) const | 56 bool FrameRateCounter::isBadFrameInterval(base::TimeDelta intervalBetweenConsecu
tiveFrames) const |
54 { | 57 { |
55 double delta = intervalBetweenConsecutiveFrames.InSecondsF(); | 58 double delta = intervalBetweenConsecutiveFrames.InSecondsF(); |
56 bool schedulerAllowsDoubleFrames = !m_hasImplThread; | 59 bool schedulerAllowsDoubleFrames = !m_hasImplThread; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 { | 123 { |
121 DCHECK(n < m_ringBuffer.BufferSize()); | 124 DCHECK(n < m_ringBuffer.BufferSize()); |
122 | 125 |
123 if (m_ringBuffer.IsFilledIndex(n)) | 126 if (m_ringBuffer.IsFilledIndex(n)) |
124 return m_ringBuffer.ReadBuffer(n); | 127 return m_ringBuffer.ReadBuffer(n); |
125 | 128 |
126 return base::TimeTicks(); | 129 return base::TimeTicks(); |
127 } | 130 } |
128 | 131 |
129 } // namespace cc | 132 } // namespace cc |
OLD | NEW |