OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkBenchmark.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 fDraw.fMatrix = &fIdentity; | 42 fDraw.fMatrix = &fIdentity; |
43 fDraw.fClip = &fRC.bwRgn(); | 43 fDraw.fClip = &fRC.bwRgn(); |
44 fDraw.fRC = &fRC; | 44 fDraw.fRC = &fRC; |
45 } | 45 } |
46 | 46 |
47 protected: | 47 protected: |
48 virtual const char* onGetName() SK_OVERRIDE { | 48 virtual const char* onGetName() SK_OVERRIDE { |
49 return fName.c_str(); | 49 return fName.c_str(); |
50 } | 50 } |
51 | 51 |
52 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 52 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE { |
53 if (fDrawCoverage) { | 53 if (fDrawCoverage) { |
54 for (int i = 0; i < this->getLoops(); ++i) { | 54 for (int i = 0; i < loops; ++i) { |
55 fDraw.drawPathCoverage(fPath, fPaint); | 55 fDraw.drawPathCoverage(fPath, fPaint); |
56 } | 56 } |
57 } else { | 57 } else { |
58 for (int i = 0; i < this->getLoops(); ++i) { | 58 for (int i = 0; i < loops; ++i) { |
59 fDraw.drawPath(fPath, fPaint); | 59 fDraw.drawPath(fPath, fPaint); |
60 } | 60 } |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 private: | 64 private: |
65 typedef SkBenchmark INHERITED; | 65 typedef SkBenchmark INHERITED; |
66 }; | 66 }; |
67 | 67 |
68 /////////////////////////////////////////////////////////////////////////////// | 68 /////////////////////////////////////////////////////////////////////////////// |
69 | 69 |
70 DEF_BENCH( return new DrawPathBench(false) ) | 70 DEF_BENCH( return new DrawPathBench(false) ) |
71 DEF_BENCH( return new DrawPathBench(true) ) | 71 DEF_BENCH( return new DrawPathBench(true) ) |
OLD | NEW |