diff options
author | Yuqian Li <liyuqian@google.com> | 2017-10-23 17:00:52 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-23 21:36:51 +0000 |
commit | 3c31281c329fd7d349205d155b0cd0f668061781 (patch) | |
tree | 6ce18032cf58b19f4ec5d5de26abca91269d7048 | |
parent | bb67b7338d7a7b0b187c97ddc891344b57e4671c (diff) |
Print measure info before closeWindow
The closeWindow function does not guarantee the calling of
~SampleWindow (in Windows and Mac). So we print the info earlier.
Bug: skia:
Change-Id: Ib8b11cac4fb2fc7b62a02c7fb7f3aaaa48df2da6
Reviewed-on: https://skia-review.googlesource.com/63140
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Yuqian Li <liyuqian@google.com>
-rw-r--r-- | samplecode/SampleApp.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index 7f6a58812f..b7d080cfbc 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -1065,10 +1065,6 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev } SampleWindow::~SampleWindow() { - if (fMeasureFPS) { - SkDebugf("Average frame time of the last slide: %.4f ms\n", - fCumulativeFPS_Time / (float)SkTMax(1, fCumulativeFPS_Count)); - } SkSafeUnref(fDevManager); } @@ -2289,6 +2285,8 @@ bool SampleWindow::getRawTitle(SkString* title) { void SampleWindow::updateTitle() { if (fMeasureMS > 0 && (int)gAnimTimer.msec() > fMeasureMS) { + SkDebugf("Average frame time of the last slide: %.4f ms\n", + fCumulativeFPS_Time / (float)SkTMax(1, fCumulativeFPS_Count)); this->closeWindow(); } |