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

Side by Side Diff: bench/MorphologyBench.cpp

Issue 347823004: Remove Sk prefix from some bench classes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkGMBench -> GMBench Created 6 years, 6 months 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
« no previous file with comments | « bench/MergeBench.cpp ('k') | bench/MutexBench.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 2012 Google Inc. 2 * Copyright 2012 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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkMorphologyImageFilter.h"
10 #include "SkPaint.h" 11 #include "SkPaint.h"
11 #include "SkRandom.h" 12 #include "SkRandom.h"
12 #include "SkShader.h" 13 #include "SkShader.h"
13 #include "SkString.h" 14 #include "SkString.h"
14 #include "SkMorphologyImageFilter.h"
15 15
16 #define SMALL SkIntToScalar(2) 16 #define SMALL SkIntToScalar(2)
17 #define REAL 1.5f 17 #define REAL 1.5f
18 #define BIG SkIntToScalar(10) 18 #define BIG SkIntToScalar(10)
19 19
20 enum MorphologyType { 20 enum MorphologyType {
21 kErode_MT, 21 kErode_MT,
22 kDilate_MT 22 kDilate_MT
23 }; 23 };
24 24
25 static const char* gStyleName[] = { 25 static const char* gStyleName[] = {
26 "erode", 26 "erode",
27 "dilate" 27 "dilate"
28 }; 28 };
29 29
30 class MorphologyBench : public SkBenchmark { 30 class MorphologyBench : public Benchmark {
31 SkScalar fRadius; 31 SkScalar fRadius;
32 MorphologyType fStyle; 32 MorphologyType fStyle;
33 SkString fName; 33 SkString fName;
34 34
35 public: 35 public:
36 MorphologyBench(SkScalar rad, MorphologyType style) 36 MorphologyBench(SkScalar rad, MorphologyType style)
37 { 37 {
38 fRadius = rad; 38 fRadius = rad;
39 fStyle = style; 39 fStyle = style;
40 const char* name = rad > 0 ? gStyleName[style] : "none"; 40 const char* name = rad > 0 ? gStyleName[style] : "none";
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 SkScalarFloorToInt(fRadius)) ; 74 SkScalarFloorToInt(fRadius)) ;
75 break; 75 break;
76 } 76 }
77 paint.setImageFilter(mf)->unref(); 77 paint.setImageFilter(mf)->unref();
78 } 78 }
79 canvas->drawOval(r, paint); 79 canvas->drawOval(r, paint);
80 } 80 }
81 } 81 }
82 82
83 private: 83 private:
84 typedef SkBenchmark INHERITED; 84 typedef Benchmark INHERITED;
85 }; 85 };
86 86
87 DEF_BENCH( return new MorphologyBench(SMALL, kErode_MT); ) 87 DEF_BENCH( return new MorphologyBench(SMALL, kErode_MT); )
88 DEF_BENCH( return new MorphologyBench(SMALL, kDilate_MT); ) 88 DEF_BENCH( return new MorphologyBench(SMALL, kDilate_MT); )
89 89
90 DEF_BENCH( return new MorphologyBench(BIG, kErode_MT); ) 90 DEF_BENCH( return new MorphologyBench(BIG, kErode_MT); )
91 DEF_BENCH( return new MorphologyBench(BIG, kDilate_MT); ) 91 DEF_BENCH( return new MorphologyBench(BIG, kDilate_MT); )
92 92
93 DEF_BENCH( return new MorphologyBench(REAL, kErode_MT); ) 93 DEF_BENCH( return new MorphologyBench(REAL, kErode_MT); )
94 DEF_BENCH( return new MorphologyBench(REAL, kDilate_MT); ) 94 DEF_BENCH( return new MorphologyBench(REAL, kDilate_MT); )
95 95
96 DEF_BENCH( return new MorphologyBench(0, kErode_MT); ) 96 DEF_BENCH( return new MorphologyBench(0, kErode_MT); )
OLDNEW
« no previous file with comments | « bench/MergeBench.cpp ('k') | bench/MutexBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698