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

Side by Side Diff: bench/MorphologyBench.cpp

Issue 111353003: deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPREC… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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/BlurBench.cpp ('k') | debugger/QT/SkGLWidget.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 "SkBenchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 23 matching lines...) Expand all
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";
41 if (SkScalarFraction(rad) != 0) { 41 if (SkScalarFraction(rad) != 0) {
42 fName.printf("morph_%.2f_%s", SkScalarToFloat(rad), name); 42 fName.printf("morph_%.2f_%s", SkScalarToFloat(rad), name);
43 } else { 43 } else {
44 fName.printf("morph_%d_%s", SkScalarRound(rad), name); 44 fName.printf("morph_%d_%s", SkScalarRoundToInt(rad), name);
45 } 45 }
46 } 46 }
47 47
48 protected: 48 protected:
49 virtual const char* onGetName() { 49 virtual const char* onGetName() {
50 return fName.c_str(); 50 return fName.c_str();
51 } 51 }
52 52
53 virtual void onDraw(const int loops, SkCanvas* canvas) { 53 virtual void onDraw(const int loops, SkCanvas* canvas) {
54 SkPaint paint; 54 SkPaint paint;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/BlurBench.cpp ('k') | debugger/QT/SkGLWidget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698