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

Side by Side Diff: tools/VisualBench/VisualStreamTimingModule.h

Issue 1385073002: Create VisualStreamTimingModule (Closed) Base URL: https://skia.googlesource.com/skia.git@vb3a
Patch Set: feedback inc 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef VisualStreamTimingModule_DEFINED
9 #define VisualStreamTimingModule_DEFINED
10
11 #include "VisualModule.h"
12
13 #include "TimingStateMachine.h"
14 #include "VisualBench.h"
15 #include "VisualBenchmarkStream.h"
16
17 /*
18 * VisualStreamTimingModule is the base class for modules which want to time a s tream of Benchmarks.
19 *
20 * Subclasses should implement renderFrame, which is called for each frame, and timingFinished,
21 * which is called when a sample has finished timing.
22 */
23 class VisualStreamTimingModule : public VisualModule {
24 public:
25 VisualStreamTimingModule(VisualBench* owner, bool preWarmBeforeSample);
26 void draw(SkCanvas* canvas) override;
27
28 private:
29 virtual void renderFrame(SkCanvas*, Benchmark*, int loops)=0;
30
31 // subclasses should return true to advance the stream
32 virtual bool timingFinished(Benchmark*, int loops, double measurement)=0;
33
34 bool nextBenchmarkIfNecessary(SkCanvas*);
35
36 TimingStateMachine fTSM;
37 SkAutoTDelete<VisualBenchmarkStream> fBenchmarkStream;
38 SkAutoTUnref<Benchmark> fBenchmark;
39 bool fReinitializeBenchmark;
40 bool fPreWarmBeforeSample;
41
42 // support framework
43 VisualBench* fOwner;
44
45 typedef VisualModule INHERITED;
46 };
47
48 #endif
OLDNEW
« 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