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
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 99ceb3e..88c7f4b 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -813,7 +813,14 @@
#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::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[] = {