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 | 7 |
8 #include "SkBenchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkCanvas.h" | |
9 #include "gm.h" | 10 #include "gm.h" |
10 #include "SkCanvas.h" | |
11 | 11 |
12 /** | 12 /** |
13 * Runs a GM as a benchmark by repeatedly drawing the GM. | 13 * Runs a GM as a benchmark by repeatedly drawing the GM. |
14 */ | 14 */ |
15 class SkGMBench : public SkBenchmark { | 15 class SkGMBench : public Benchmark { |
mtklein
2014/06/19 18:45:17
This too can probably become GMBench.
tfarina
2014/06/19 19:02:01
Done.
| |
16 public: | 16 public: |
17 // Constructor takes ownership of the GM param. | 17 // Constructor takes ownership of the GM param. |
18 SkGMBench(skiagm::GM* gm); | 18 SkGMBench(skiagm::GM* gm); |
19 virtual ~SkGMBench(); | 19 virtual ~SkGMBench(); |
20 | 20 |
21 protected: | 21 protected: |
22 virtual const char* onGetName() SK_OVERRIDE; | 22 virtual const char* onGetName() SK_OVERRIDE; |
23 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE; | 23 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE; |
24 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE; | 24 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE; |
25 virtual SkIPoint onGetSize() SK_OVERRIDE; | 25 virtual SkIPoint onGetSize() SK_OVERRIDE; |
26 | 26 |
27 private: | 27 private: |
28 skiagm::GM* fGM; | 28 skiagm::GM* fGM; |
29 SkString fName; | 29 SkString fName; |
30 typedef SkBenchmark INHERITED; | 30 typedef Benchmark INHERITED; |
31 }; | 31 }; |
OLD | NEW |