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 |
(...skipping 16 matching lines...) Expand all Loading... |
27 int calculateLoops(int defaultLoops) const override { | 27 int calculateLoops(int defaultLoops) const override { |
28 return fDoLooping ? defaultLoops : 1; | 28 return fDoLooping ? defaultLoops : 1; |
29 } | 29 } |
30 | 30 |
31 protected: | 31 protected: |
32 const char* onGetName() override; | 32 const char* onGetName() override; |
33 const char* onGetUniqueName() override; | 33 const char* onGetUniqueName() override; |
34 void onPerCanvasPreDraw(SkCanvas*) override; | 34 void onPerCanvasPreDraw(SkCanvas*) override; |
35 void onPerCanvasPostDraw(SkCanvas*) override; | 35 void onPerCanvasPostDraw(SkCanvas*) override; |
36 bool isSuitableFor(Backend backend) override; | 36 bool isSuitableFor(Backend backend) override; |
37 void onDraw(const int loops, SkCanvas* canvas) override; | 37 void onDraw(int loops, SkCanvas* canvas) override; |
38 SkIPoint onGetSize() override; | 38 SkIPoint onGetSize() override; |
39 | 39 |
40 virtual void drawMPDPicture(); | 40 virtual void drawMPDPicture(); |
41 virtual void drawPicture(); | 41 virtual void drawPicture(); |
42 | 42 |
43 const SkPicture* picture() const { return fPic; } | 43 const SkPicture* picture() const { return fPic; } |
44 const SkTDArray<SkSurface*>& surfaces() const { return fSurfaces; } | 44 const SkTDArray<SkSurface*>& surfaces() const { return fSurfaces; } |
45 const SkTDArray<SkIRect>& tileRects() const { return fTileRects; } | 45 const SkTDArray<SkIRect>& tileRects() const { return fTileRects; } |
46 | 46 |
47 private: | 47 private: |
48 SkAutoTUnref<const SkPicture> fPic; | 48 SkAutoTUnref<const SkPicture> fPic; |
49 const SkIRect fClip; | 49 const SkIRect fClip; |
50 const SkScalar fScale; | 50 const SkScalar fScale; |
51 SkString fName; | 51 SkString fName; |
52 SkString fUniqueName; | 52 SkString fUniqueName; |
53 | 53 |
54 const bool fUseMultiPictureDraw; | 54 const bool fUseMultiPictureDraw; |
55 SkTDArray<SkSurface*> fSurfaces; // for MultiPictureDraw | 55 SkTDArray<SkSurface*> fSurfaces; // for MultiPictureDraw |
56 SkTDArray<SkIRect> fTileRects; // for MultiPictureDraw | 56 SkTDArray<SkIRect> fTileRects; // for MultiPictureDraw |
57 | 57 |
58 const bool fDoLooping; | 58 const bool fDoLooping; |
59 | 59 |
60 typedef Benchmark INHERITED; | 60 typedef Benchmark INHERITED; |
61 }; | 61 }; |
62 | 62 |
63 #endif | 63 #endif |
OLD | NEW |