joshualitt | 962cc98 | 2015-06-30 07:43:14 -0700 | [diff] [blame] | 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 VisualBenchmarkStream_DEFINED |
| 10 | #define VisualBenchmarkStream_DEFINED |
| 11 | |
| 12 | #include "Benchmark.h" |
| 13 | #include "gm.h" |
| 14 | #include "SkCommandLineFlags.h" |
| 15 | #include "SkPicture.h" |
| 16 | |
| 17 | DECLARE_string(match); |
| 18 | |
| 19 | class VisualBenchmarkStream { |
| 20 | public: |
joshualitt | 6ebd423 | 2015-12-04 09:02:34 -0800 | [diff] [blame] | 21 | VisualBenchmarkStream(const SkSurfaceProps&, bool justSKP = false); |
joshualitt | 962cc98 | 2015-06-30 07:43:14 -0700 | [diff] [blame] | 22 | |
| 23 | static bool ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic); |
| 24 | |
| 25 | Benchmark* next(); |
joshualitt | c603c14 | 2015-10-15 07:18:29 -0700 | [diff] [blame] | 26 | Benchmark* current() { return fBenchmark.get(); } |
joshualitt | 962cc98 | 2015-06-30 07:43:14 -0700 | [diff] [blame] | 27 | |
| 28 | private: |
joshualitt | 82874f8 | 2015-07-15 08:38:02 -0700 | [diff] [blame] | 29 | Benchmark* innerNext(); |
| 30 | |
cdalton | c70483f | 2015-10-26 13:14:36 -0700 | [diff] [blame] | 31 | SkSurfaceProps fSurfaceProps; |
joshualitt | 962cc98 | 2015-06-30 07:43:14 -0700 | [diff] [blame] | 32 | const BenchRegistry* fBenches; |
| 33 | const skiagm::GMRegistry* fGMs; |
| 34 | SkTArray<SkString> fSKPs; |
joshualitt | c603c14 | 2015-10-15 07:18:29 -0700 | [diff] [blame] | 35 | SkAutoTUnref<Benchmark> fBenchmark; |
joshualitt | 962cc98 | 2015-06-30 07:43:14 -0700 | [diff] [blame] | 36 | |
| 37 | const char* fSourceType; // What we're benching: bench, GM, SKP, ... |
| 38 | const char* fBenchType; // How we bench it: micro, playback, ... |
| 39 | int fCurrentSKP; |
joshualitt | 98d2e2f | 2015-10-05 07:23:30 -0700 | [diff] [blame] | 40 | bool fIsWarmedUp; |
joshualitt | 962cc98 | 2015-06-30 07:43:14 -0700 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | #endif |