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/debug/frame_rate_counter.h" | 5 #include "cc/debug/frame_rate_counter.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <limits> | 10 #include <limits> |
11 | 11 |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram_macros.h" |
14 #include "cc/trees/proxy.h" | 14 #include "cc/trees/proxy.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 | 17 |
18 // The following constants are measured in seconds. | 18 // The following constants are measured in seconds. |
19 | 19 |
20 // Two thresholds (measured in seconds) that describe what is considered to be a | 20 // Two thresholds (measured in seconds) that describe what is considered to be a |
21 // "no-op frame" that should not be counted. | 21 // "no-op frame" that should not be counted. |
22 // - if the frame is too fast, then given our compositor implementation, the | 22 // - if the frame is too fast, then given our compositor implementation, the |
23 // frame probably was a no-op and did not draw. | 23 // frame probably was a no-op and did not draw. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 if (frame_count) { | 144 if (frame_count) { |
145 DCHECK_GT(frame_times_total, 0.0); | 145 DCHECK_GT(frame_times_total, 0.0); |
146 average_fps = frame_count / frame_times_total; | 146 average_fps = frame_count / frame_times_total; |
147 } | 147 } |
148 | 148 |
149 return average_fps; | 149 return average_fps; |
150 } | 150 } |
151 | 151 |
152 } // namespace cc | 152 } // namespace cc |
OLD | NEW |