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

Unified Diff: tools/VisualBench/VisualInteractiveModule.h

Issue 1382883003: move visual bench interactive module to timing state machine (Closed) Base URL: https://skia.googlesource.com/skia.git@vb
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/TimingStateMachine.cpp ('k') | tools/VisualBench/VisualInteractiveModule.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/VisualInteractiveModule.h
diff --git a/tools/VisualBench/VisualInteractiveModule.h b/tools/VisualBench/VisualInteractiveModule.h
index 4ff6a36ef905dd7494c50f56c8f719e7c44de2e6..30d968a5d32cc77b59ee1c20b697803563e6fa47 100755
--- a/tools/VisualBench/VisualInteractiveModule.h
+++ b/tools/VisualBench/VisualInteractiveModule.h
@@ -14,6 +14,7 @@
#include "ResultsWriter.h"
#include "SkPicture.h"
#include "Timer.h"
+#include "TimingStateMachine.h"
#include "VisualBench.h"
#include "VisualBenchmarkStream.h"
@@ -31,57 +32,21 @@ public:
bool onHandleChar(SkUnichar unichar) override;
private:
- /*
- * The heart of visual bench is an event driven timing loop.
- * kPreWarmLoopsPerCanvasPreDraw_State: Before we begin timing, Benchmarks have a hook to
- * access the canvas. Then we prewarm before the autotune
- * loops step.
- * kPreWarmLoops_State: We prewarm the gpu before auto tuning to enter a steady
- * work state
- * kTuneLoops_State: Then we tune the loops of the benchmark to ensure we
- * are doing a measurable amount of work
- * kPreTiming_State: Because reset the context after tuning loops to ensure
- * coherent state, we need to restart before timing
- * kTiming_State: Finally we time the benchmark. In this case we
- * continue running and displaying benchmark data
- * until we quit or switch to another benchmark
- * kAdvance_State: Advance to the next benchmark in the stream
- */
- enum State {
- kPreWarmLoopsPerCanvasPreDraw_State,
- kPreWarmLoops_State,
- kTuneLoops_State,
- kPreTiming_State,
- kTiming_State,
- kAdvance_State,
- };
void setTitle();
bool setupBackend();
void setupRenderTarget();
void drawStats(SkCanvas*);
bool advanceRecordIfNecessary(SkCanvas*);
inline void renderFrame(SkCanvas*);
- inline void nextState(State);
- void perCanvasPreDraw(SkCanvas*, State);
- void preWarm(State nextState);
- void scaleLoops(double elapsedMs);
- inline void tuneLoops(SkCanvas*);
- inline void timing(SkCanvas*);
- inline double elapsed();
- void resetTimingState();
- void postDraw(SkCanvas*);
- void recordMeasurement();
static const int kMeasurementCount = 64; // should be power of 2 for fast mod
double fMeasurements[kMeasurementCount];
int fCurrentMeasurement;
- int fCurrentFrame;
- int fLoops;
- WallTimer fTimer;
- State fState;
SkAutoTDelete<VisualBenchmarkStream> fBenchmarkStream;
SkAutoTUnref<Benchmark> fBenchmark;
+ TimingStateMachine fTSM;
+ bool fAdvance;
// support framework
SkAutoTUnref<VisualBench> fOwner;
« no previous file with comments | « tools/VisualBench/TimingStateMachine.cpp ('k') | tools/VisualBench/VisualInteractiveModule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698