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

Unified Diff: bench/RectoriBench.cpp

Issue 23701006: Push sigma-based blur interface into our GMs/benches/tests/samplecode (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: cleaned up Created 7 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/BlurRectBench.cpp ('k') | gm/bitmapmatrix.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/RectoriBench.cpp
===================================================================
--- bench/RectoriBench.cpp (revision 11108)
+++ bench/RectoriBench.cpp (working copy)
@@ -28,8 +28,8 @@
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 @@
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 @@
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 @@
enum { N = SkBENCHLOOP(100) };
- SkLayerDrawLooper* createLooper(SkScalar xOff, SkScalar radius) {
+ SkLayerDrawLooper* createLooper(SkScalar xOff, SkScalar sigma) {
SkLayerDrawLooper* looper = new SkLayerDrawLooper;
//-----------------------------------------------
@@ -88,8 +88,8 @@
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();
« no previous file with comments | « bench/BlurRectBench.cpp ('k') | gm/bitmapmatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698