Index: tools/VisualBench/VisualStreamTimingModule.cpp |
diff --git a/tools/VisualBench/VisualStreamTimingModule.cpp b/tools/VisualBench/VisualStreamTimingModule.cpp |
index cecc5acca7284a635a7eae4236c806d164cf14a1..c3aa17e5e14f276d72bd2087cd8e19ada5b78c2d 100644 |
--- a/tools/VisualBench/VisualStreamTimingModule.cpp |
+++ b/tools/VisualBench/VisualStreamTimingModule.cpp |
@@ -10,7 +10,7 @@ |
#include "SkCanvas.h" |
VisualStreamTimingModule::VisualStreamTimingModule(VisualBench* owner, bool preWarmBeforeSample) |
- : fInitState(kReset_InitState) |
+ : fInitState(kInitial_InitState) |
, fPreWarmBeforeSample(preWarmBeforeSample) |
, fOwner(owner) { |
fBenchmarkStream.reset(new VisualBenchmarkStream); |
@@ -18,10 +18,16 @@ VisualStreamTimingModule::VisualStreamTimingModule(VisualBench* owner, bool preW |
inline void VisualStreamTimingModule::handleInitState(SkCanvas* canvas) { |
switch (fInitState) { |
+ case kInitial_InitState: |
+ SkDebugf("1\n"); |
+ fBenchmarkStream->next(fOwner->currentConfig()); |
+ // fall through |
case kNewBenchmark_InitState: |
+ SkDebugf("2\n"); |
fBenchmarkStream->current()->delayedSetup(); |
// fallthrough |
case kReset_InitState: |
+ SkDebugf("3\n"); |
// This will flicker unfortunately, but as we are reseting the GLContext each bench, |
// we unfortunately don't have a choice |
fOwner->clear(canvas, SK_ColorWHITE, 2); |
@@ -49,9 +55,13 @@ inline void VisualStreamTimingModule::handleTimingEvent(SkCanvas* canvas, |
if (this->timingFinished(fBenchmarkStream->current(), fTSM.loops(), |
fTSM.lastMeasurement())) { |
fTSM.nextBenchmark(); |
- if (!fBenchmarkStream->next()) { |
- SkDebugf("Exiting VisualBench successfully\n"); |
- fOwner->closeWindow(); |
+ if (!fBenchmarkStream->next(fOwner->currentConfig())) { |
+ if (!fOwner->nextConfig()) { |
+ SkDebugf("Exiting VisualBench successfully\n"); |
+ fOwner->closeWindow(); |
+ } else { |
+ fBenchmarkStream.reset(new VisualBenchmarkStream); |
+ } |
} else { |
fInitState = kNewBenchmark_InitState; |
} |