blob: b1fd0f08c722dbcc60814b80b2ecb7c165809ec9 [file] [log] [blame]
joshualitt962cc982015-06-30 07:43:14 -07001/*
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
17DECLARE_string(match);
18
19class VisualBenchmarkStream {
20public:
joshualitt6ebd4232015-12-04 09:02:34 -080021 VisualBenchmarkStream(const SkSurfaceProps&, bool justSKP = false);
joshualitt962cc982015-06-30 07:43:14 -070022
23 static bool ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic);
24
25 Benchmark* next();
joshualittc603c142015-10-15 07:18:29 -070026 Benchmark* current() { return fBenchmark.get(); }
joshualitt962cc982015-06-30 07:43:14 -070027
28private:
joshualitt82874f82015-07-15 08:38:02 -070029 Benchmark* innerNext();
30
cdaltonc70483f2015-10-26 13:14:36 -070031 SkSurfaceProps fSurfaceProps;
joshualitt962cc982015-06-30 07:43:14 -070032 const BenchRegistry* fBenches;
33 const skiagm::GMRegistry* fGMs;
34 SkTArray<SkString> fSKPs;
joshualittc603c142015-10-15 07:18:29 -070035 SkAutoTUnref<Benchmark> fBenchmark;
joshualitt962cc982015-06-30 07:43:14 -070036
37 const char* fSourceType; // What we're benching: bench, GM, SKP, ...
38 const char* fBenchType; // How we bench it: micro, playback, ...
39 int fCurrentSKP;
joshualitt98d2e2f2015-10-05 07:23:30 -070040 bool fIsWarmedUp;
joshualitt962cc982015-06-30 07:43:14 -070041};
42
43#endif