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

Unified Diff: gm/drawlooper.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, 4 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
Index: gm/drawlooper.cpp
===================================================================
--- gm/drawlooper.cpp (revision 11004)
+++ gm/drawlooper.cpp (working copy)
@@ -62,12 +62,12 @@
SkPaint::Style fStyle;
SkScalar fWidth;
SkScalar fOffset;
- int fBlur;
+ SkScalar fSigma;
} gParams[] = {
{ SK_ColorWHITE, SkPaint::kStroke_Style, SkIntToScalar(1)*3/4, 0, 0 },
{ SK_ColorRED, SkPaint::kStroke_Style, SkIntToScalar(4), 0, 0 },
{ SK_ColorBLUE, SkPaint::kFill_Style, 0, 0, 0 },
- { 0x88000000, SkPaint::kFill_Style, 0, SkIntToScalar(10), 3 }
+ { 0x88000000, SkPaint::kFill_Style, 0, SkIntToScalar(10), SkFloatToScalar(2.23205f) }
};
fLooper = new SkLayerDrawLooper;
@@ -84,9 +84,9 @@
paint->setColor(gParams[i].fColor);
paint->setStyle(gParams[i].fStyle);
paint->setStrokeWidth(gParams[i].fWidth);
- if (gParams[i].fBlur > 0) {
- SkMaskFilter* mf = SkBlurMaskFilter::Create(SkIntToScalar(gParams[i].fBlur),
- SkBlurMaskFilter::kNormal_BlurStyle);
+ if (gParams[i].fSigma > 0) {
+ SkMaskFilter* mf = SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle,
+ gParams[i].fSigma);
paint->setMaskFilter(mf)->unref();
}
}
« bench/BlurBench.cpp ('K') | « gm/drawbitmaprect.cpp ('k') | gm/megalooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698