Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: bench/BlurRectBench.cpp

Issue 99893003: Simplify benchmark internal API. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bench/BlurImageFilterBench.cpp ('k') | bench/BlurRoundRectBench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 SkScalar radius() const { 46 SkScalar radius() const {
47 return fRadius; 47 return fRadius;
48 } 48 }
49 49
50 void setName(const SkString& name) { 50 void setName(const SkString& name) {
51 fName = name; 51 fName = name;
52 } 52 }
53 53
54 virtual void onDraw(SkCanvas*) { 54 virtual void onDraw(const int loops, SkCanvas*) {
55 SkPaint paint; 55 SkPaint paint;
56 this->setupPaint(&paint); 56 this->setupPaint(&paint);
57 57
58 paint.setAntiAlias(true); 58 paint.setAntiAlias(true);
59 59
60 SkScalar pad = fRadius*3/2 + SK_Scalar1; 60 SkScalar pad = fRadius*3/2 + SK_Scalar1;
61 SkRect r = SkRect::MakeWH(2 * pad + SK_Scalar1, 2 * pad + SK_Scalar1); 61 SkRect r = SkRect::MakeWH(2 * pad + SK_Scalar1, 2 * pad + SK_Scalar1);
62 62
63 preBenchSetup(r); 63 preBenchSetup(r);
64 64
65 for (int i = 0; i < this->getLoops(); i++) { 65 for (int i = 0; i < loops; i++) {
66 makeBlurryRect(r); 66 makeBlurryRect(r);
67 } 67 }
68 } 68 }
69 69
70 virtual void makeBlurryRect(const SkRect&) = 0; 70 virtual void makeBlurryRect(const SkRect&) = 0;
71 virtual void preBenchSetup(const SkRect&) {} 71 virtual void preBenchSetup(const SkRect&) {}
72 private: 72 private:
73 typedef SkBenchmark INHERITED; 73 typedef SkBenchmark INHERITED;
74 }; 74 };
75 75
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(12));) 220 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(12));)
221 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(13));) 221 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(13));)
222 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(14));) 222 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(14));)
223 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(15));) 223 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(15));)
224 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(16));) 224 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(16));)
225 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(17));) 225 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(17));)
226 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(18));) 226 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(18));)
227 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(19));) 227 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(19));)
228 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(20));) 228 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(20));)
229 #endif 229 #endif
OLDNEW
« no previous file with comments | « bench/BlurImageFilterBench.cpp ('k') | bench/BlurRoundRectBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698