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

Unified Diff: tools/VisualBench/TimingStateMachine.cpp

Issue 1444473003: Make visualbench timing continuous for no-reset mode (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_no_reset
Patch Set: Created 5 years, 1 month 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/TimingStateMachine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/TimingStateMachine.cpp
diff --git a/tools/VisualBench/TimingStateMachine.cpp b/tools/VisualBench/TimingStateMachine.cpp
index 4dfa3f575575a75cf3acf936840345dcd4a96a97..00e0b618e740d10c2cf94d768de90e57d9c8a059 100644
--- a/tools/VisualBench/TimingStateMachine.cpp
+++ b/tools/VisualBench/TimingStateMachine.cpp
@@ -45,27 +45,28 @@ TimingStateMachine::ParentEvents TimingStateMachine::nextFrame(bool preWarmBetwe
SkDebugf("InnerLoops wrapped\n");
fLoops = 1;
} else {
- double elapsedMs = this->elapsed();
+ double elapsedMs = now_ms() - fStartTime;
if (elapsedMs < FLAGS_loopMs) {
fLoops *= 2;
} else {
fInnerState = kTiming_InnerState;
}
fState = kPreWarm_State;
- this->resetTimingState();
+ fCurrentFrame = 0;
parentEvent = kReset_ParentEvents;
}
break;
}
case kTiming_InnerState: {
if (fCurrentFrame >= FLAGS_frames) {
- this->recordMeasurement();
- this->resetTimingState();
+ double now = now_ms();
+ fLastMeasurement = (now - fStartTime) / (FLAGS_frames * fLoops);
+ fCurrentFrame = 0;
parentEvent = kTimingFinished_ParentEvents;
if (preWarmBetweenSamples) {
fState = kPreWarm_State;
} else {
- fStartTime = now_ms();
+ fStartTime = now;
}
} else {
fCurrentFrame++;
@@ -79,18 +80,6 @@ TimingStateMachine::ParentEvents TimingStateMachine::nextFrame(bool preWarmBetwe
return parentEvent;
}
-inline double TimingStateMachine::elapsed() {
- return now_ms() - fStartTime;
-}
-
-void TimingStateMachine::resetTimingState() {
- fCurrentFrame = 0;
-}
-
-void TimingStateMachine::recordMeasurement() {
- fLastMeasurement = this->elapsed() / (FLAGS_frames * fLoops);
-}
-
void TimingStateMachine::nextBenchmark() {
fLoops = 1;
fInnerState = kTuning_InnerState;
« no previous file with comments | « tools/VisualBench/TimingStateMachine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698