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

Unified Diff: samplecode/SampleEffects.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/SampleBlur.cpp ('k') | samplecode/SampleEmboss.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleEffects.cpp
===================================================================
--- samplecode/SampleEffects.cpp (revision 11108)
+++ samplecode/SampleEffects.cpp (working copy)
@@ -6,15 +6,16 @@
* found in the LICENSE file.
*/
#include "SampleCode.h"
+#include "SkBlurMask.h"
+#include "SkBlurMaskFilter.h"
#include "SkCanvas.h"
-#include "SkPaint.h"
-#include "SkView.h"
-
-#include "SkBlurMaskFilter.h"
#include "SkColorMatrixFilter.h"
#include "SkDiscretePathEffect.h"
#include "SkGradientShader.h"
+#include "SkPaint.h"
+#include "SkView.h"
+
//#define COLOR 0xFFFF8844
#define COLOR 0xFF888888
@@ -22,14 +23,18 @@
}
static void paint_proc1(SkPaint* paint) {
- paint->setMaskFilter(SkBlurMaskFilter::Create(2,
- SkBlurMaskFilter::kNormal_BlurStyle))->unref();
+ paint->setMaskFilter(SkBlurMaskFilter::Create(
+ SkBlurMaskFilter::kNormal_BlurStyle,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(2))))->unref();
}
static void paint_proc2(SkPaint* paint) {
SkScalar dir[3] = { 1, 1, 1};
paint->setMaskFilter(
- SkBlurMaskFilter::CreateEmboss(dir, 0.1f, 0.05f, 1))->unref();
+ SkBlurMaskFilter::CreateEmboss(SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(1)),
+ dir,
+ SkFloatToScalar(0.1f),
+ SkFloatToScalar(0.05f)))->unref();
}
static void paint_proc3(SkPaint* paint) {
« no previous file with comments | « samplecode/SampleBlur.cpp ('k') | samplecode/SampleEmboss.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698