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

Unified Diff: samplecode/SampleAll.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, 4 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
Index: samplecode/SampleAll.cpp
===================================================================
--- samplecode/SampleAll.cpp (revision 11004)
+++ samplecode/SampleAll.cpp (working copy)
@@ -79,8 +79,8 @@
///////////////////////////////////////////////////////////
static void r0(SkLayerRasterizer* rast, SkPaint& p) {
- p.setMaskFilter(SkBlurMaskFilter::Create(SkIntToScalar(3),
- SkBlurMaskFilter::kNormal_BlurStyle,
+ p.setMaskFilter(SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle,
+ SkFloatToScalar(2.23205f),
SkBlurMaskFilter::kNone_BlurFlag))->unref();
rast->addLayer(p, SkIntToScalar(3), SkIntToScalar(3));
@@ -255,10 +255,9 @@
#if 1
SkScalar dir[] = { SK_Scalar1, SK_Scalar1, SK_Scalar1 };
- paint->setMaskFilter(SkBlurMaskFilter::CreateEmboss(dir,
+ paint->setMaskFilter(SkBlurMaskFilter::CreateEmboss(SkFloatToScalar(2.23205f), dir,
SK_Scalar1/4,
- SkIntToScalar(4),
- SkIntToScalar(3)))->unref();
+ SkIntToScalar(4)))->unref();
paint->setColor(SK_ColorBLUE);
#endif
}
@@ -386,8 +385,8 @@
light.fDirection[2] = SK_Scalar1/3;
light.fAmbient = 0x48;
light.fSpecular = 0x80;
- SkScalar radius = SkIntToScalar(12)/5;
- SkEmbossMaskFilter* embossFilter = new SkEmbossMaskFilter(light, radius);
+ SkScalar sigma = SkFloatToScalar(1.88564f);
+ SkEmbossMaskFilter* embossFilter = new SkEmbossMaskFilter(sigma, light);
SkXfermode* xfermode = SkXfermode::Create(SkXfermode::kXor_Mode);
SkColorFilter* lightingFilter = SkColorFilter::CreateLightingFilter(
« bench/BlurBench.cpp ('K') | « gm/tilemodes.cpp ('k') | samplecode/SampleAnimBlur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698