Index: samplecode/SampleApp.cpp |
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp |
index 2d12bfd67293bbaccc9107befbdb11d3ad6e317a..956669a8246f46289464c41753aeca02b5a03eda 100644 |
--- a/samplecode/SampleApp.cpp |
+++ b/samplecode/SampleApp.cpp |
@@ -1311,8 +1311,9 @@ void SampleWindow::afterChildren(SkCanvas* orig) { |
} |
// Do this after presentGL and other finishing, rather than in afterChild |
- if (fMeasureFPS && fMeasureFPS_StartTime) { |
- fMeasureFPS_Time += SkTime::GetMSecs() - fMeasureFPS_StartTime; |
+ if (fMeasureFPS) { |
+ fTimer.end(); |
+ fMeasureFPS_Time += fTimer.fWall; |
} |
} |
@@ -1349,9 +1350,8 @@ void SampleWindow::beforeChild(SkView* child, SkCanvas* canvas) { |
} |
if (fMeasureFPS) { |
- if (SampleView::SetRepeatDraw(child, FPS_REPEAT_COUNT)) { |
- fMeasureFPS_StartTime = SkTime::GetMSecs(); |
- } |
+ (void)SampleView::SetRepeatDraw(child, FPS_REPEAT_COUNT); |
+ fTimer.start(); |
} else { |
(void)SampleView::SetRepeatDraw(child, 1); |
} |
@@ -1933,7 +1933,7 @@ void SampleWindow::updateTitle() { |
} |
if (fMeasureFPS) { |
- title.appendf(" %8.3f ms", fMeasureFPS_Time / (float)FPS_REPEAT_COUNT); |
+ title.appendf(" %8.4f ms", fMeasureFPS_Time / (float)FPS_REPEAT_COUNT); |
} |
SkView* view = curr_view(this); |