Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 * | 6 * |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef VisualInteractiveModule_DEFINED | 9 #ifndef VisualInteractiveModule_DEFINED |
| 10 #define VisualInteractiveModule_DEFINED | 10 #define VisualInteractiveModule_DEFINED |
| 11 | 11 |
| 12 #include "VisualModule.h" | 12 #include "VisualStreamTimingModule.h" |
| 13 | |
| 14 #include "ResultsWriter.h" | |
| 15 #include "SkPicture.h" | |
| 16 #include "Timer.h" | |
| 17 #include "TimingStateMachine.h" | |
| 18 #include "VisualBench.h" | |
| 19 #include "VisualBenchmarkStream.h" | |
| 20 | 13 |
| 21 class SkCanvas; | 14 class SkCanvas; |
| 22 | 15 |
| 23 /* | 16 /* |
| 24 * This module for VisualBench is designed to display stats data dynamically | 17 * This module for VisualBench is designed to display stats data dynamically |
| 25 */ | 18 */ |
| 26 class VisualInteractiveModule : public VisualModule { | 19 class VisualInteractiveModule : public VisualStreamTimingModule { |
| 27 public: | 20 public: |
| 28 // TODO get rid of backpointer | 21 // TODO get rid of backpointer |
| 29 VisualInteractiveModule(VisualBench* owner); | 22 VisualInteractiveModule(VisualBench* owner); |
| 30 | 23 |
|
robertphillips
2015/10/06 12:19:46
This should still be an override, right ?
joshualitt
2015/10/07 19:33:52
Acknowledged.
| |
| 31 void draw(SkCanvas* canvas) override; | 24 bool onHandleChar(SkUnichar c); |
| 32 bool onHandleChar(SkUnichar unichar) override; | |
| 33 | 25 |
| 34 private: | 26 private: |
| 35 void setTitle(); | |
| 36 bool setupBackend(); | |
| 37 void setupRenderTarget(); | |
| 38 void drawStats(SkCanvas*); | 27 void drawStats(SkCanvas*); |
| 39 bool advanceRecordIfNecessary(SkCanvas*); | 28 void renderFrame(SkCanvas*, Benchmark*, int loops) override; |
| 40 inline void renderFrame(SkCanvas*); | 29 bool timingFinished(Benchmark*, int loops, double measurement) override; |
| 41 | 30 |
| 42 static const int kMeasurementCount = 64; // should be power of 2 for fast m od | 31 static const int kMeasurementCount = 64; // should be power of 2 for fast m od |
| 43 double fMeasurements[kMeasurementCount]; | 32 double fMeasurements[kMeasurementCount]; |
| 44 int fCurrentMeasurement; | 33 int fCurrentMeasurement; |
| 34 bool fAdvance; | |
| 45 | 35 |
| 46 SkAutoTDelete<VisualBenchmarkStream> fBenchmarkStream; | 36 typedef VisualStreamTimingModule INHERITED; |
| 47 SkAutoTUnref<Benchmark> fBenchmark; | |
| 48 TimingStateMachine fTSM; | |
| 49 bool fAdvance; | |
| 50 bool fHasBeenReset; | |
| 51 | |
| 52 // support framework | |
| 53 SkAutoTUnref<VisualBench> fOwner; | |
| 54 | |
| 55 typedef VisualModule INHERITED; | |
| 56 }; | 37 }; |
| 57 | 38 |
| 58 #endif | 39 #endif |
| OLD | NEW |