diff options
author | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-11-22 15:58:06 +0000 |
---|---|---|
committer | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-11-22 15:58:06 +0000 |
commit | 8caac6447dd68655b57dfe876626a9733b191416 (patch) | |
tree | 50b6cb4ba346aacd12d2a21f5ee8cee9d0574b4e /bench | |
parent | 1f6b4ae0f723317d01b158ce1498dabf4d93a67b (diff) |
Add fractional-radius blurs to blur benchmark.
Specialize loops in apply_kernel and apply_kernel_interp,
improving blur benchmark performance by 25%.
git-svn-id: http://skia.googlecode.com/svn/trunk@2731 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench')
-rw-r--r-- | bench/BlurBench.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bench/BlurBench.cpp b/bench/BlurBench.cpp index 1a69184dba..de78fe1f9a 100644 --- a/bench/BlurBench.cpp +++ b/bench/BlurBench.cpp @@ -14,6 +14,7 @@ #include "SkBlurMaskFilter.h" #define SMALL SkIntToScalar(2) +#define REAL SkFloatToScalar(1.5f) #define BIG SkIntToScalar(10) static const char* gStyleName[] = { @@ -33,7 +34,11 @@ public: fRadius = rad; fStyle = bs; const char* name = rad > 0 ? gStyleName[bs] : "none"; - fName.printf("blur_%d_%s", SkScalarRound(rad), name); + if (SkScalarFraction(rad) != 0) { + fName.printf("blur_%.2f_%s", SkScalarToFloat(rad), name); + } else { + fName.printf("blur_%d_%s", SkScalarRound(rad), name); + } } protected: @@ -75,6 +80,11 @@ static SkBenchmark* Fact11(void* p) { return new BlurBench(p, BIG, SkBlurMaskFil static SkBenchmark* Fact12(void* p) { return new BlurBench(p, BIG, SkBlurMaskFilter::kOuter_BlurStyle); } static SkBenchmark* Fact13(void* p) { return new BlurBench(p, BIG, SkBlurMaskFilter::kInner_BlurStyle); } +static SkBenchmark* Fact20(void* p) { return new BlurBench(p, REAL, SkBlurMaskFilter::kNormal_BlurStyle); } +static SkBenchmark* Fact21(void* p) { return new BlurBench(p, REAL, SkBlurMaskFilter::kSolid_BlurStyle); } +static SkBenchmark* Fact22(void* p) { return new BlurBench(p, REAL, SkBlurMaskFilter::kOuter_BlurStyle); } +static SkBenchmark* Fact23(void* p) { return new BlurBench(p, REAL, SkBlurMaskFilter::kInner_BlurStyle); } + static SkBenchmark* FactNone(void* p) { return new BlurBench(p, 0, SkBlurMaskFilter::kNormal_BlurStyle); } static BenchRegistry gReg00(Fact00); @@ -87,5 +97,10 @@ static BenchRegistry gReg11(Fact11); static BenchRegistry gReg12(Fact12); static BenchRegistry gReg13(Fact13); +static BenchRegistry gReg20(Fact20); +static BenchRegistry gReg21(Fact21); +static BenchRegistry gReg22(Fact22); +static BenchRegistry gReg23(Fact23); + static BenchRegistry gRegNone(FactNone); |