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 "Benchmark.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
11 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
12 #include "SkDraw.h" | 12 #include "SkDraw.h" |
13 #include "SkMatrix.h" | 13 #include "SkMatrix.h" |
14 #include "SkPath.h" | 14 #include "SkPath.h" |
15 #include "SkRasterClip.h" | 15 #include "SkRasterClip.h" |
16 | 16 |
17 class DrawPathBench : public SkBenchmark { | 17 class DrawPathBench : public Benchmark { |
18 SkPaint fPaint; | 18 SkPaint fPaint; |
19 SkString fName; | 19 SkString fName; |
20 SkPath fPath; | 20 SkPath fPath; |
21 SkRasterClip fRC; | 21 SkRasterClip fRC; |
22 SkBitmap fBitmap; | 22 SkBitmap fBitmap; |
23 SkMatrix fIdentity; | 23 SkMatrix fIdentity; |
24 SkDraw fDraw; | 24 SkDraw fDraw; |
25 bool fDrawCoverage; | 25 bool fDrawCoverage; |
26 public: | 26 public: |
27 DrawPathBench(bool drawCoverage) : fDrawCoverage(drawCoverage) { | 27 DrawPathBench(bool drawCoverage) : fDrawCoverage(drawCoverage) { |
(...skipping 26 matching lines...) Expand all Loading... |
54 fDraw.drawPathCoverage(fPath, fPaint); | 54 fDraw.drawPathCoverage(fPath, fPaint); |
55 } | 55 } |
56 } else { | 56 } else { |
57 for (int i = 0; i < loops; ++i) { | 57 for (int i = 0; i < loops; ++i) { |
58 fDraw.drawPath(fPath, fPaint); | 58 fDraw.drawPath(fPath, fPaint); |
59 } | 59 } |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 private: | 63 private: |
64 typedef SkBenchmark INHERITED; | 64 typedef Benchmark INHERITED; |
65 }; | 65 }; |
66 | 66 |
67 /////////////////////////////////////////////////////////////////////////////// | 67 /////////////////////////////////////////////////////////////////////////////// |
68 | 68 |
69 DEF_BENCH( return new DrawPathBench(false) ) | 69 DEF_BENCH( return new DrawPathBench(false) ) |
70 DEF_BENCH( return new DrawPathBench(true) ) | 70 DEF_BENCH( return new DrawPathBench(true) ) |
OLD | NEW |