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 bool useMultiPictureDraw); | 21 bool useMultiPictureDraw); |
22 ~SKPBench() SK_OVERRIDE; | 22 ~SKPBench() override; |
23 | 23 |
24 protected: | 24 protected: |
25 const char* onGetName() SK_OVERRIDE; | 25 const char* onGetName() override; |
26 const char* onGetUniqueName() SK_OVERRIDE; | 26 const char* onGetUniqueName() override; |
27 void onPerCanvasPreDraw(SkCanvas*) SK_OVERRIDE; | 27 void onPerCanvasPreDraw(SkCanvas*) override; |
28 void onPerCanvasPostDraw(SkCanvas*) SK_OVERRIDE; | 28 void onPerCanvasPostDraw(SkCanvas*) override; |
29 bool isSuitableFor(Backend backend) SK_OVERRIDE; | 29 bool isSuitableFor(Backend backend) override; |
30 void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE; | 30 void onDraw(const int loops, SkCanvas* canvas) override; |
31 SkIPoint onGetSize() SK_OVERRIDE; | 31 SkIPoint onGetSize() override; |
32 | 32 |
33 private: | 33 private: |
34 SkAutoTUnref<const SkPicture> fPic; | 34 SkAutoTUnref<const SkPicture> fPic; |
35 const SkIRect fClip; | 35 const SkIRect fClip; |
36 const SkScalar fScale; | 36 const SkScalar fScale; |
37 SkString fName; | 37 SkString fName; |
38 SkString fUniqueName; | 38 SkString fUniqueName; |
39 | 39 |
40 const bool fUseMultiPictureDraw; | 40 const bool fUseMultiPictureDraw; |
41 SkTDArray<SkSurface*> fSurfaces; // for MultiPictureDraw | 41 SkTDArray<SkSurface*> fSurfaces; // for MultiPictureDraw |
42 SkTDArray<SkIRect> fTileRects; // for MultiPictureDraw | 42 SkTDArray<SkIRect> fTileRects; // for MultiPictureDraw |
43 | 43 |
44 typedef Benchmark INHERITED; | 44 typedef Benchmark INHERITED; |
45 }; | 45 }; |
46 | 46 |
47 #endif | 47 #endif |
OLD | NEW |