diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-06 14:16:12 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-06 14:16:12 +0000 |
commit | b7061176c7f414616fe2e79e832b3e0abe326af6 (patch) | |
tree | 05269431ac1dfa9b62d5fa34a0351e2f21af712e /gm/drawlooper.cpp | |
parent | b27eba7c28c7a52e6af91743ab51c266ed96dccd (diff) |
Push sigma-based blur interface into our GMs/benches/tests/samplecode
https://codereview.chromium.org/23701006/
git-svn-id: http://skia.googlecode.com/svn/trunk@11129 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/drawlooper.cpp')
-rw-r--r-- | gm/drawlooper.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gm/drawlooper.cpp b/gm/drawlooper.cpp index 58c691c311..4cc6e8e369 100644 --- a/gm/drawlooper.cpp +++ b/gm/drawlooper.cpp @@ -6,11 +6,12 @@ */ #include "gm.h" +#include "SkBlurMask.h" +#include "SkBlurMaskFilter.h" #include "SkCanvas.h" #include "SkGraphics.h" -#include "SkRandom.h" #include "SkLayerDrawLooper.h" -#include "SkBlurMaskFilter.h" +#include "SkRandom.h" #define WIDTH 200 #define HEIGHT 200 @@ -62,12 +63,12 @@ private: SkPaint::Style fStyle; SkScalar fWidth; SkScalar fOffset; - int fBlur; + SkScalar fBlur; } 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), SkIntToScalar(3) } }; fLooper = new SkLayerDrawLooper; @@ -85,8 +86,8 @@ private: 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); + SkMaskFilter* mf = SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle, + SkBlurMask::ConvertRadiusToSigma(gParams[i].fBlur)); paint->setMaskFilter(mf)->unref(); } } |