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

Unified Diff: samplecode/SampleBlur.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 | « samplecode/SampleBigBlur.cpp ('k') | samplecode/SampleEffects.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleBlur.cpp
===================================================================
--- samplecode/SampleBlur.cpp (revision 11108)
+++ samplecode/SampleBlur.cpp (working copy)
@@ -6,12 +6,13 @@
* found in the LICENSE file.
*/
#include "SampleCode.h"
+#include "SkBlurMask.h"
#include "SkBlurMaskFilter.h"
+#include "SkCanvas.h"
#include "SkColorPriv.h"
#include "SkGradientShader.h"
+#include "SkUtils.h"
#include "SkView.h"
-#include "SkCanvas.h"
-#include "SkUtils.h"
static SkBitmap make_bitmap() {
SkBitmap bm;
@@ -97,9 +98,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(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);
@@ -109,9 +110,9 @@
}
// draw text
{
- SkMaskFilter* mf = SkBlurMaskFilter::Create(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 | « samplecode/SampleBigBlur.cpp ('k') | samplecode/SampleEffects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698