blob: e16310e034be6d556fea049d5bda23eca73e5c29 [file] [log] [blame]
John Recke702c9c2015-10-07 10:26:02 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef TESTS_BENCHMARK_H
17#define TESTS_BENCHMARK_H
18
19#include <string>
20#include <vector>
21
22namespace android {
23namespace uirenderer {
24
25struct BenchmarkOptions {
26 int count;
27};
28
29typedef void (*BenchmarkFunctor)(const BenchmarkOptions&);
30
31struct BenchmarkInfo {
32 std::string name;
33 std::string description;
34 BenchmarkFunctor functor;
35};
36
37class Benchmark {
38public:
39 Benchmark(const BenchmarkInfo& info) {
40 registerBenchmark(info);
41 }
42
43private:
44 Benchmark() = delete;
45 Benchmark(const Benchmark&) = delete;
46 Benchmark& operator=(const Benchmark&) = delete;
47
48 static void registerBenchmark(const BenchmarkInfo& info);
49};
50
51} /* namespace uirenderer */
52} /* namespace android */
53
54#endif /* TESTS_BENCHMARK_H */