| Index: tools/VisualBench/VisualInteractiveModule.cpp
|
| diff --git a/tools/VisualBench/VisualInteractiveModule.cpp b/tools/VisualBench/VisualInteractiveModule.cpp
|
| index 8f020c4ba4de19ae55658c635efbb937d49afcf8..f40db54d0087b31f1a823e667e2b656ddfdf28b7 100755
|
| --- a/tools/VisualBench/VisualInteractiveModule.cpp
|
| +++ b/tools/VisualBench/VisualInteractiveModule.cpp
|
| @@ -27,6 +27,7 @@ VisualInteractiveModule::VisualInteractiveModule(VisualBench* owner)
|
| : fCurrentMeasurement(0)
|
| , fBenchmark(nullptr)
|
| , fAdvance(false)
|
| + , fHasBeenReset(false)
|
| , fOwner(SkRef(owner)) {
|
| fBenchmarkStream.reset(new VisualBenchmarkStream);
|
|
|
| @@ -93,7 +94,7 @@ bool VisualInteractiveModule::advanceRecordIfNecessary(SkCanvas* canvas) {
|
| fOwner->clear(canvas, SK_ColorWHITE, 2);
|
|
|
| fBenchmark->delayedSetup();
|
| -
|
| + fBenchmark->preTimingHooks(canvas);
|
| return true;
|
| }
|
|
|
| @@ -103,10 +104,18 @@ void VisualInteractiveModule::draw(SkCanvas* canvas) {
|
| fOwner->closeWindow();
|
| return;
|
| }
|
| +
|
| + if (fHasBeenReset) {
|
| + fHasBeenReset = false;
|
| + fBenchmark->preTimingHooks(canvas);
|
| + }
|
| +
|
| this->renderFrame(canvas);
|
| - TimingStateMachine::ParentEvents event = fTSM.nextFrame(canvas, fBenchmark);
|
| + TimingStateMachine::ParentEvents event = fTSM.nextFrame(false);
|
| switch (event) {
|
| case TimingStateMachine::kReset_ParentEvents:
|
| + fBenchmark->postTimingHooks(canvas);
|
| + fHasBeenReset = true;
|
| fOwner->reset();
|
| break;
|
| case TimingStateMachine::kTiming_ParentEvents:
|
| @@ -120,10 +129,10 @@ void VisualInteractiveModule::draw(SkCanvas* canvas) {
|
| if (fAdvance) {
|
| fAdvance = false;
|
| fTSM.nextBenchmark(canvas, fBenchmark);
|
| + fBenchmark->postTimingHooks(canvas);
|
| fBenchmark.reset(nullptr);
|
| fOwner->reset();
|
| - } else {
|
| - fTSM.nextSample();
|
| + fHasBeenReset = true;
|
| }
|
| break;
|
| }
|
|
|