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 #ifndef SKPBench_DEFINED | 8 #ifndef SKPBench_DEFINED |
9 #define SKPBench_DEFINED | 9 #define SKPBench_DEFINED |
10 | 10 |
11 #include "Benchmark.h" | 11 #include "Benchmark.h" |
12 #include "SkCanvas.h" | 12 #include "SkCanvas.h" |
13 #include "SkPicture.h" | 13 #include "SkPicture.h" |
14 | 14 |
15 /** | 15 /** |
16 * Runs an SkPicture as a benchmark by repeatedly drawing it scaled inside a dev
ice clip. | 16 * Runs an SkPicture as a benchmark by repeatedly drawing it scaled inside a dev
ice clip. |
17 */ | 17 */ |
18 class SKPBench : public Benchmark { | 18 class SKPBench : public Benchmark { |
19 public: | 19 public: |
20 SKPBench(const char* name, const SkPicture*, const SkIRect& devClip, SkScala
r scale); | 20 SKPBench(const char* name, const SkPicture*, const SkIRect& devClip, SkScala
r scale); |
21 | 21 |
22 protected: | 22 protected: |
23 virtual const char* onGetName() SK_OVERRIDE; | 23 virtual const char* onGetName() SK_OVERRIDE; |
| 24 virtual const char* onGetUniqueName() SK_OVERRIDE; |
24 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE; | 25 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE; |
25 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE; | 26 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE; |
26 virtual SkIPoint onGetSize() SK_OVERRIDE; | 27 virtual SkIPoint onGetSize() SK_OVERRIDE; |
27 | 28 |
28 private: | 29 private: |
29 SkAutoTUnref<const SkPicture> fPic; | 30 SkAutoTUnref<const SkPicture> fPic; |
30 const SkIRect fClip; | 31 const SkIRect fClip; |
31 const SkScalar fScale; | 32 const SkScalar fScale; |
32 SkString fName; | 33 SkString fName; |
| 34 SkString fUniqueName; |
33 | 35 |
34 typedef Benchmark INHERITED; | 36 typedef Benchmark INHERITED; |
35 }; | 37 }; |
36 | 38 |
37 #endif | 39 #endif |
OLD | NEW |