OLD | NEW |
(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 |
| 9 #ifndef VisualStreamTimingModule_DEFINED |
| 10 #define VisualStreamTimingModule_DEFINED |
| 11 |
| 12 #include "VisualModule.h" |
| 13 |
| 14 #include "TimingStateMachine.h" |
| 15 #include "VisualBench.h" |
| 16 #include "VisualBenchmarkStream.h" |
| 17 |
| 18 /* |
| 19 * VisualStreamTimingModule is the base class for modules which want to time a s
tream of Benchmarks |
| 20 */ |
| 21 class VisualStreamTimingModule : public VisualModule { |
| 22 public: |
| 23 VisualStreamTimingModule(VisualBench* owner, bool preWarmBeforeSample); |
| 24 void draw(SkCanvas* canvas) override; |
| 25 |
| 26 private: |
| 27 virtual void renderFrame(SkCanvas*, Benchmark*, int loops)=0; |
| 28 |
| 29 // subclasses should return true to advance the stream |
| 30 virtual bool timingFinished(Benchmark*, int loops, double measurement)=0; |
| 31 |
| 32 bool nextBenchmarkIfNecessary(SkCanvas*); |
| 33 |
| 34 TimingStateMachine fTSM; |
| 35 SkAutoTDelete<VisualBenchmarkStream> fBenchmarkStream; |
| 36 SkAutoTUnref<Benchmark> fBenchmark; |
| 37 bool fHasBeenReset; |
| 38 bool fPreWarmBeforeSample; |
| 39 |
| 40 // support framework |
| 41 SkAutoTUnref<VisualBench> fOwner; |
| 42 |
| 43 typedef VisualModule INHERITED; |
| 44 }; |
| 45 |
| 46 #endif |
OLD | NEW |