Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: tools/VisualBench/VisualStreamTimingModule.cpp

Issue 1413713006: Wire up configurations properly in VisualBench (Closed) Base URL: https://skia.googlesource.com/skia.git@detachattach
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/VisualBench/VisualStreamTimingModule.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « tools/VisualBench/VisualStreamTimingModule.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698