OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef GMBench_DEFINED |
| 8 #define GMBench_DEFINED |
7 | 9 |
8 #include "Benchmark.h" | 10 #include "Benchmark.h" |
9 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
10 #include "gm.h" | 12 #include "gm.h" |
11 | 13 |
12 /** | 14 /** |
13 * Runs a GM as a benchmark by repeatedly drawing the GM. | 15 * Runs a GM as a benchmark by repeatedly drawing the GM. |
14 */ | 16 */ |
15 class GMBench : public Benchmark { | 17 class GMBench : public Benchmark { |
16 public: | 18 public: |
17 // Constructor takes ownership of the GM param. | 19 // Constructor takes ownership of the GM param. |
18 GMBench(skiagm::GM* gm); | 20 GMBench(skiagm::GM* gm); |
19 virtual ~GMBench(); | 21 virtual ~GMBench(); |
20 | 22 |
21 protected: | 23 protected: |
22 virtual const char* onGetName() SK_OVERRIDE; | 24 virtual const char* onGetName() SK_OVERRIDE; |
23 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE; | 25 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE; |
24 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE; | 26 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE; |
25 virtual SkIPoint onGetSize() SK_OVERRIDE; | 27 virtual SkIPoint onGetSize() SK_OVERRIDE; |
26 | 28 |
27 private: | 29 private: |
28 skiagm::GM* fGM; | 30 skiagm::GM* fGM; |
29 SkString fName; | 31 SkString fName; |
30 typedef Benchmark INHERITED; | 32 typedef Benchmark INHERITED; |
31 }; | 33 }; |
| 34 |
| 35 #endif |
OLD | NEW |