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

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

Issue 23998002: cc: Fixed computation of dropped frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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 | « no previous file | tools/perf/metrics/smoothness.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.CompositorThreadImplDrawDelay", 66 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.CompositorThreadImplDrawDelay",
67 frame_interval_seconds.InMilliseconds(), 67 frame_interval_seconds.InMilliseconds(),
68 1, 68 1,
69 120, 69 120,
70 60); 70 60);
71 } 71 }
72 } 72 }
73 73
74 if (!IsBadFrameInterval(frame_interval_seconds) && 74 if (!IsBadFrameInterval(frame_interval_seconds) &&
75 frame_interval_seconds.InSecondsF() > kDroppedFrameTime) 75 frame_interval_seconds.InSecondsF() > kDroppedFrameTime)
76 ++dropped_frame_count_; 76 dropped_frame_count_ +=
77 frame_interval_seconds.InSecondsF() / kDroppedFrameTime;
77 } 78 }
78 79
79 bool FrameRateCounter::IsBadFrameInterval( 80 bool FrameRateCounter::IsBadFrameInterval(
80 base::TimeDelta interval_between_consecutive_frames) const { 81 base::TimeDelta interval_between_consecutive_frames) const {
81 double delta = interval_between_consecutive_frames.InSecondsF(); 82 double delta = interval_between_consecutive_frames.InSecondsF();
82 bool scheduler_allows_double_frames = !has_impl_thread_; 83 bool scheduler_allows_double_frames = !has_impl_thread_;
83 bool interval_too_fast = 84 bool interval_too_fast =
84 scheduler_allows_double_frames ? delta < kFrameTooFast : delta <= 0.0; 85 scheduler_allows_double_frames ? delta < kFrameTooFast : delta <= 0.0;
85 bool interval_too_slow = delta > kFrameTooSlow; 86 bool interval_too_slow = delta > kFrameTooSlow;
86 return interval_too_fast || interval_too_slow; 87 return interval_too_fast || interval_too_slow;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 139
139 if (frame_count) { 140 if (frame_count) {
140 DCHECK_GT(frame_times_total, 0.0); 141 DCHECK_GT(frame_times_total, 0.0);
141 average_fps = frame_count / frame_times_total; 142 average_fps = frame_count / frame_times_total;
142 } 143 }
143 144
144 return average_fps; 145 return average_fps;
145 } 146 }
146 147
147 } // namespace cc 148 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | tools/perf/metrics/smoothness.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698