aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/RectoriBench.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-06 14:16:12 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-06 14:16:12 +0000
commitb7061176c7f414616fe2e79e832b3e0abe326af6 (patch)
tree05269431ac1dfa9b62d5fa34a0351e2f21af712e /bench/RectoriBench.cpp
parentb27eba7c28c7a52e6af91743ab51c266ed96dccd (diff)
Push sigma-based blur interface into our GMs/benches/tests/samplecode
Diffstat (limited to 'bench/RectoriBench.cpp')
-rw-r--r--bench/RectoriBench.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/bench/RectoriBench.cpp b/bench/RectoriBench.cpp
index 80996c9760..1aa9814207 100644
--- a/bench/RectoriBench.cpp
+++ b/bench/RectoriBench.cpp
@@ -28,8 +28,8 @@ protected:
SkMWCRandom Random;
for (int i = 0; i < N; i++) {
- SkScalar blurRad = Random.nextRangeScalar(1.5f, 25.0f);
- SkScalar size = Random.nextRangeScalar(20*blurRad, 50*blurRad);
+ SkScalar blurSigma = Random.nextRangeScalar(1.5f, 25.0f);
+ SkScalar size = Random.nextRangeScalar(20*blurSigma, 50*blurSigma);
SkScalar x = Random.nextRangeScalar(0.0f, W - size);
SkScalar y = Random.nextRangeScalar(0.0f, H - size);
@@ -38,7 +38,7 @@ protected:
SkRect outer(inner);
// outer is always outset either 2x or 4x the blur radius (we go with 2x)
- outer.outset(2*blurRad, 2*blurRad);
+ outer.outset(2*blurSigma, 2*blurSigma);
SkPath p;
@@ -51,7 +51,7 @@ protected:
SkScalar translate = 2.0f * size;
SkPaint paint;
- paint.setLooper(this->createLooper(-translate, blurRad))->unref();
+ paint.setLooper(this->createLooper(-translate, blurSigma))->unref();
paint.setColor(0xff000000 | Random.nextU());
paint.setAntiAlias(true);
@@ -72,7 +72,7 @@ private:
enum { N = SkBENCHLOOP(100) };
- SkLayerDrawLooper* createLooper(SkScalar xOff, SkScalar radius) {
+ SkLayerDrawLooper* createLooper(SkScalar xOff, SkScalar sigma) {
SkLayerDrawLooper* looper = new SkLayerDrawLooper;
//-----------------------------------------------
@@ -88,8 +88,8 @@ private:
SkPaint* paint = looper->addLayer(info);
- SkMaskFilter* mf = SkBlurMaskFilter::Create(radius,
- SkBlurMaskFilter::kNormal_BlurStyle,
+ SkMaskFilter* mf = SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle,
+ sigma,
SkBlurMaskFilter::kHighQuality_BlurFlag);
paint->setMaskFilter(mf)->unref();