OLD | NEW |
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 "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 name.printf("blurrect_direct_%d", SkScalarRoundToInt(rad)); | 85 name.printf("blurrect_direct_%d", SkScalarRoundToInt(rad)); |
86 } | 86 } |
87 | 87 |
88 this->setName(name); | 88 this->setName(name); |
89 } | 89 } |
90 protected: | 90 protected: |
91 void makeBlurryRect(const SkRect& r) override { | 91 void makeBlurryRect(const SkRect& r) override { |
92 SkMask mask; | 92 SkMask mask; |
93 if (!SkBlurMask::BlurRect(SkBlurMask::ConvertRadiusToSigma(this->radius(
)), | 93 if (!SkBlurMask::BlurRect(SkBlurMask::ConvertRadiusToSigma(this->radius(
)), |
94 &mask, r, kNormal_SkBlurStyle)) { | 94 &mask, r, kNormal_SkBlurStyle)) { |
95 return; | 95 return; |
96 } | 96 } |
97 SkMask::FreeImage(mask.fImage); | 97 SkMask::FreeImage(mask.fImage); |
98 } | 98 } |
99 private: | 99 private: |
100 typedef BlurRectBench INHERITED; | 100 typedef BlurRectBench INHERITED; |
101 }; | 101 }; |
102 | 102 |
103 class BlurRectSeparableBench: public BlurRectBench { | 103 class BlurRectSeparableBench: public BlurRectBench { |
104 | 104 |
105 public: | 105 public: |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(12));) | 221 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(12));) |
222 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(13));) | 222 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(13));) |
223 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(14));) | 223 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(14));) |
224 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(15));) | 224 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(15));) |
225 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(16));) | 225 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(16));) |
226 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(17));) | 226 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(17));) |
227 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(18));) | 227 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(18));) |
228 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(19));) | 228 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(19));) |
229 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(20));) | 229 DEF_BENCH(return new BlurRectGaussianBench(SkIntToScalar(20));) |
230 #endif | 230 #endif |
OLD | NEW |