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

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, 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/drawbitmaprect.cpp ('k') | gm/megalooper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/drawlooper.cpp
===================================================================
--- gm/drawlooper.cpp (revision 11108)
+++ gm/drawlooper.cpp (working copy)
@@ -6,11 +6,12 @@
*/
#include "gm.h"
+#include "SkBlurMask.h"
+#include "SkBlurMaskFilter.h"
#include "SkCanvas.h"
#include "SkGraphics.h"
+#include "SkLayerDrawLooper.h"
#include "SkRandom.h"
-#include "SkLayerDrawLooper.h"
-#include "SkBlurMaskFilter.h"
#define WIDTH 200
#define HEIGHT 200
@@ -62,12 +63,12 @@
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 @@
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();
}
}
« no previous file with comments | « gm/drawbitmaprect.cpp ('k') | gm/megalooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698