diff options
author | 2011-04-25 14:31:44 +0000 | |
---|---|---|
committer | 2011-04-25 14:31:44 +0000 | |
commit | 17d7aec8967f7e2f6bb420c6647be11285fac2f1 (patch) | |
tree | 88d7d6cd268664fe0219ffd44f36a2554dd5c241 /samplecode/SampleApp.cpp | |
parent | 205d46067ace24bd4b111cf44efc96caff6c4d30 (diff) |
move end-timer for FPS to afterChildren, so we will have flushed opengl
git-svn-id: http://skia.googlecode.com/svn/trunk@1170 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleApp.cpp')
-rw-r--r-- | samplecode/SampleApp.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index 99ceb3e9b2..88c7f4b70c 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -813,7 +813,14 @@ void SampleWindow::afterChildren(SkCanvas* orig) { #endif } -// if ((fScrollTestX | fScrollTestY) != 0) + // Do this after presentGL and other finishing, rather than in afterChild + if (fMeasureFPS && fMeasureFPS_Time) { + fMeasureFPS_Time = SkTime::GetMSecs() - fMeasureFPS_Time; + this->updateTitle(); + postInvalDelay(this->getSinkID()); + } + + // if ((fScrollTestX | fScrollTestY) != 0) if (false) { const SkBitmap& bm = orig->getDevice()->accessBitmap(true); int dx = fScrollTestX * 7; @@ -861,12 +868,6 @@ void SampleWindow::beforeChild(SkView* child, SkCanvas* canvas) { void SampleWindow::afterChild(SkView* child, SkCanvas* canvas) { canvas->setDrawFilter(NULL); - - if (fMeasureFPS && fMeasureFPS_Time) { - fMeasureFPS_Time = SkTime::GetMSecs() - fMeasureFPS_Time; - this->updateTitle(); - postInvalDelay(this->getSinkID()); - } } static SkBitmap::Config gConfigCycle[] = { |