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

Unified Diff: cc/heads_up_display_layer_impl.cc

Issue 11817011: cc: add RingBuffer class for timestamp storing in FrameRateCounter (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: switched to FrameRateCounter has a RingBuffer Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: cc/heads_up_display_layer_impl.cc
diff --git a/cc/heads_up_display_layer_impl.cc b/cc/heads_up_display_layer_impl.cc
index 177f349558981a9a7d302b80ad99d555fb2c584b..e65015462937cb1bd5000d85c7179bb2cdecc682 100644
--- a/cc/heads_up_display_layer_impl.cc
+++ b/cc/heads_up_display_layer_impl.cc
@@ -208,9 +208,10 @@ int HeadsUpDisplayLayerImpl::drawFPSCounter(SkCanvas* canvas, FrameRateCounter*
void HeadsUpDisplayLayerImpl::drawFPSCounterText(SkCanvas* canvas, SkPaint& paint, FrameRateCounter* fpsCounter, SkRect bounds)
{
// Update FPS text - not every frame so text is readable
- if (base::TimeDelta(fpsCounter->timeStampOfRecentFrame(0) - textUpdateTime).InSecondsF() > 0.25) {
+ base::TimeTicks now = base::TimeTicks::Now();
egraether 2013/01/10 02:32:09 This should just use the current timestamp, which
+ if (base::TimeDelta(now - textUpdateTime).InSecondsF() > 0.25) {
m_averageFPS = fpsCounter->getAverageFPS();
- textUpdateTime = fpsCounter->timeStampOfRecentFrame(0);
+ textUpdateTime = now;
}
// Draw FPS text.

Powered by Google App Engine
This is Rietveld 408576698