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

Unified Diff: tools/VisualBench/VisualStreamTimingModule.h

Issue 1389763003: Create (Closed) Base URL: https://skia.googlesource.com/skia.git@vb3a
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/VisualLightweightBenchModule.cpp ('k') | tools/VisualBench/VisualStreamTimingModule.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/VisualStreamTimingModule.h
diff --git a/tools/VisualBench/VisualStreamTimingModule.h b/tools/VisualBench/VisualStreamTimingModule.h
new file mode 100644
index 0000000000000000000000000000000000000000..2ac2b24cce73a6975d97f38ddce5af02565bb721
--- /dev/null
+++ b/tools/VisualBench/VisualStreamTimingModule.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ */
+
+#ifndef VisualStreamTimingModule_DEFINED
+#define VisualStreamTimingModule_DEFINED
+
+#include "VisualModule.h"
+
+#include "TimingStateMachine.h"
+#include "VisualBench.h"
+#include "VisualBenchmarkStream.h"
+
+/*
+ * VisualStreamTimingModule is the base class for modules which want to time a stream of Benchmarks
+ */
+class VisualStreamTimingModule : public VisualModule {
+public:
+ VisualStreamTimingModule(VisualBench* owner, bool preWarmBeforeSample);
+ void draw(SkCanvas* canvas) override;
+
+private:
+ virtual void renderFrame(SkCanvas*, Benchmark*, int loops)=0;
+
+ // subclasses should return true to advance the stream
+ virtual bool timingFinished(Benchmark*, int loops, double measurement)=0;
+
+ bool nextBenchmarkIfNecessary(SkCanvas*);
+
+ TimingStateMachine fTSM;
+ SkAutoTDelete<VisualBenchmarkStream> fBenchmarkStream;
+ SkAutoTUnref<Benchmark> fBenchmark;
+ bool fHasBeenReset;
+ bool fPreWarmBeforeSample;
+
+ // support framework
+ SkAutoTUnref<VisualBench> fOwner;
+
+ typedef VisualModule INHERITED;
+};
+
+#endif
« no previous file with comments | « tools/VisualBench/VisualLightweightBenchModule.cpp ('k') | tools/VisualBench/VisualStreamTimingModule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698