aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samplecode/SampleApp.cpp')
-rw-r--r--samplecode/SampleApp.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 716998f960..cc06e04250 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1051,10 +1051,6 @@ void SampleWindow::draw(SkCanvas* canvas) {
this->updateMatrix();
}
- if (fMeasureFPS) {
- fMeasureFPS_Time = 0;
- }
-
if (fNClip) {
this->INHERITED::draw(canvas);
SkBitmap orig = capture_bitmap(canvas);
@@ -1115,11 +1111,6 @@ void SampleWindow::draw(SkCanvas* canvas) {
magnify(canvas);
}
- if (fMeasureFPS && fMeasureFPS_Time) {
- this->updateTitle();
- this->postInvalDelay();
- }
-
// do this last
fDevManager->publishCanvas(fDeviceType, canvas, this);
}
@@ -1405,8 +1396,10 @@ 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 && fMeasureFPS_Time) {
+ fMeasureFPS_Time = SkTime::GetMSecs() - fMeasureFPS_Time;
+ this->updateTitle();
+ this->postInvalDelay();
}
// if ((fScrollTestX | fScrollTestY) != 0)
@@ -1478,8 +1471,9 @@ void SampleWindow::beforeChild(SkView* child, SkCanvas* canvas) {
this->installDrawFilter(canvas);
if (fMeasureFPS) {
+ fMeasureFPS_Time = 0; // 0 means the child is not aware of repeat-draw
if (SampleView::SetRepeatDraw(child, FPS_REPEAT_COUNT)) {
- fMeasureFPS_StartTime = SkTime::GetMSecs();
+ fMeasureFPS_Time = SkTime::GetMSecs();
}
} else {
(void)SampleView::SetRepeatDraw(child, 1);
@@ -1784,13 +1778,6 @@ bool SampleWindow::onHandleChar(SkUnichar uni) {
}
switch (uni) {
- case 'b':
- {
- postEventToSink(SkNEW_ARGS(SkEvent, ("PictFileView::toggleBBox")), curr_view(this));
- this->updateTitle();
- this->inval(NULL);
- break;
- }
case 'B':
// gIgnoreFastBlurRect = !gIgnoreFastBlurRect;
this->inval(NULL);