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

Unified Diff: gm/blurs.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 | « gm/blurrect.cpp ('k') | gm/circles.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/blurs.cpp
===================================================================
--- gm/blurs.cpp (revision 11108)
+++ gm/blurs.cpp (working copy)
@@ -6,6 +6,7 @@
* found in the LICENSE file.
*/
#include "gm.h"
+#include "SkBlurMask.h"
#include "SkBlurMaskFilter.h"
namespace skiagm {
@@ -59,8 +60,9 @@
paint.setColor(SK_ColorBLUE);
for (size_t i = 0; i < SK_ARRAY_COUNT(gRecs); i++) {
if (gRecs[i].fStyle != NONE) {
- SkMaskFilter* mf = SkBlurMaskFilter::Create(
- SkIntToScalar(20), gRecs[i].fStyle, flags);
+ SkMaskFilter* mf = SkBlurMaskFilter::Create(gRecs[i].fStyle,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(20)),
+ flags);
paint.setMaskFilter(mf)->unref();
} else {
paint.setMaskFilter(NULL);
@@ -72,10 +74,9 @@
}
// draw text
{
- SkMaskFilter* mf = SkBlurMaskFilter::Create(
- SkIntToScalar(4),
- SkBlurMaskFilter::kNormal_BlurStyle,
- flags);
+ SkMaskFilter* mf = SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(4)),
+ flags);
paint.setMaskFilter(mf)->unref();
SkScalar x = SkIntToScalar(70);
SkScalar y = SkIntToScalar(400);
« no previous file with comments | « gm/blurrect.cpp ('k') | gm/circles.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698