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

Side by Side Diff: bench/BlurImageFilterBench.cpp

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium 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') | bench/BlurRectBench.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 "SkBitmapDevice.h" 9 #include "SkBitmapDevice.h"
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkPaint.h" 12 #include "SkPaint.h"
13 #include "SkRandom.h" 13 #include "SkRandom.h"
14 #include "SkShader.h" 14 #include "SkShader.h"
15 #include "SkString.h" 15 #include "SkString.h"
16 16
17 #define FILTER_WIDTH_SMALL 32 17 #define FILTER_WIDTH_SMALL 32
18 #define FILTER_HEIGHT_SMALL 32 18 #define FILTER_HEIGHT_SMALL 32
19 #define FILTER_WIDTH_LARGE 256 19 #define FILTER_WIDTH_LARGE 256
20 #define FILTER_HEIGHT_LARGE 256 20 #define FILTER_HEIGHT_LARGE 256
21 #define BLUR_SIGMA_SMALL SkFloatToScalar(1.0f) 21 #define BLUR_SIGMA_SMALL 1.0f
22 #define BLUR_SIGMA_LARGE SkFloatToScalar(10.0f) 22 #define BLUR_SIGMA_LARGE 10.0f
23 23
24 class BlurImageFilterBench : public SkBenchmark { 24 class BlurImageFilterBench : public SkBenchmark {
25 public: 25 public:
26 BlurImageFilterBench(SkScalar sigmaX, SkScalar sigmaY, bool small) : 26 BlurImageFilterBench(SkScalar sigmaX, SkScalar sigmaY, bool small) :
27 fIsSmall(small), fInitialized(false), fSigmaX(sigmaX), fSigmaY(sigmaY) { 27 fIsSmall(small), fInitialized(false), fSigmaX(sigmaX), fSigmaY(sigmaY) {
28 fName.printf("blur_image_filter_%s_%.2f_%.2f", fIsSmall ? "small" : "lar ge", 28 fName.printf("blur_image_filter_%s_%.2f_%.2f", fIsSmall ? "small" : "lar ge",
29 SkScalarToFloat(sigmaX), SkScalarToFloat(sigmaY)); 29 SkScalarToFloat(sigmaX), SkScalarToFloat(sigmaY));
30 } 30 }
31 31
32 protected: 32 protected:
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 }; 85 };
86 86
87 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, 0, false);) 87 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, 0, false);)
88 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, 0, false);) 88 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, 0, false);)
89 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_LARGE, false);) 89 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_LARGE, false);)
90 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_SMALL, false);) 90 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_SMALL, false);)
91 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, tr ue);) 91 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, tr ue);)
92 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, fa lse);) 92 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, fa lse);)
93 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, tr ue);) 93 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, tr ue);)
94 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, fa lse);) 94 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, fa lse);)
OLDNEW
« no previous file with comments | « bench/BlurBench.cpp ('k') | bench/BlurRectBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698