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

Side by Side Diff: bench/BlurBench.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 | « no previous file | bench/MorphologyBench.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 25 matching lines...) Expand all
36 BlurBench(SkScalar rad, SkBlurMaskFilter::BlurStyle bs, uint32_t flags = 0) { 36 BlurBench(SkScalar rad, SkBlurMaskFilter::BlurStyle bs, uint32_t flags = 0) {
37 fRadius = rad; 37 fRadius = rad;
38 fStyle = bs; 38 fStyle = bs;
39 fFlags = flags; 39 fFlags = flags;
40 const char* name = rad > 0 ? gStyleName[bs] : "none"; 40 const char* name = rad > 0 ? gStyleName[bs] : "none";
41 const char* quality = flags & SkBlurMaskFilter::kHighQuality_BlurFlag ? "high_quality" 41 const char* quality = flags & SkBlurMaskFilter::kHighQuality_BlurFlag ? "high_quality"
42 : "low_quality"; 42 : "low_quality";
43 if (SkScalarFraction(rad) != 0) { 43 if (SkScalarFraction(rad) != 0) {
44 fName.printf("blur_%.2f_%s_%s", SkScalarToFloat(rad), name, quality) ; 44 fName.printf("blur_%.2f_%s_%s", SkScalarToFloat(rad), name, quality) ;
45 } else { 45 } else {
46 fName.printf("blur_%d_%s_%s", SkScalarRound(rad), name, quality); 46 fName.printf("blur_%d_%s_%s", SkScalarRoundToInt(rad), name, quality );
47 } 47 }
48 } 48 }
49 49
50 protected: 50 protected:
51 virtual const char* onGetName() { 51 virtual const char* onGetName() {
52 return fName.c_str(); 52 return fName.c_str();
53 } 53 }
54 54
55 virtual void onDraw(const int loops, SkCanvas* canvas) { 55 virtual void onDraw(const int loops, SkCanvas* canvas) {
56 SkPaint paint; 56 SkPaint paint;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 DEF_BENCH(return new BlurBench(SMALL, SkBlurMaskFilter::kNormal_BlurStyle, SkBlu rMaskFilter::kHighQuality_BlurFlag);) 101 DEF_BENCH(return new BlurBench(SMALL, SkBlurMaskFilter::kNormal_BlurStyle, SkBlu rMaskFilter::kHighQuality_BlurFlag);)
102 102
103 DEF_BENCH(return new BlurBench(BIG, SkBlurMaskFilter::kNormal_BlurStyle, SkBlurM askFilter::kHighQuality_BlurFlag);) 103 DEF_BENCH(return new BlurBench(BIG, SkBlurMaskFilter::kNormal_BlurStyle, SkBlurM askFilter::kHighQuality_BlurFlag);)
104 104
105 DEF_BENCH(return new BlurBench(REALBIG, SkBlurMaskFilter::kNormal_BlurStyle, SkB lurMaskFilter::kHighQuality_BlurFlag);) 105 DEF_BENCH(return new BlurBench(REALBIG, SkBlurMaskFilter::kNormal_BlurStyle, SkB lurMaskFilter::kHighQuality_BlurFlag);)
106 106
107 DEF_BENCH(return new BlurBench(REAL, SkBlurMaskFilter::kNormal_BlurStyle, SkBlur MaskFilter::kHighQuality_BlurFlag);) 107 DEF_BENCH(return new BlurBench(REAL, SkBlurMaskFilter::kNormal_BlurStyle, SkBlur MaskFilter::kHighQuality_BlurFlag);)
108 108
109 DEF_BENCH(return new BlurBench(0, SkBlurMaskFilter::kNormal_BlurStyle);) 109 DEF_BENCH(return new BlurBench(0, SkBlurMaskFilter::kNormal_BlurStyle);)
OLDNEW
« no previous file with comments | « no previous file | bench/MorphologyBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698