we do not correctly handle inner-style in blurmaskfilter w/ the 9patch
trick, so don't use it (until we fix it).
extend blurrect gm to test all 4 blurstyles
Review URL: https://codereview.appspot.com/6940075
git-svn-id: http://skia.googlecode.com/svn/trunk@6864 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/blurrect.cpp b/gm/blurrect.cpp
index 3d9a33a..c28468a 100644
--- a/gm/blurrect.cpp
+++ b/gm/blurrect.cpp
@@ -71,20 +71,29 @@
paint->setShader(s)->unref();
}
+static const char* gBlurStyle2Name[] = {
+ "normal",
+ "solid",
+ "outer",
+ "inner"
+};
+
class BlurRectGM : public skiagm::GM {
SkAutoTUnref<SkMaskFilter> fMaskFilter;
SkString fName;
PaintProc fPProc;
SkAlpha fAlpha;
public:
- BlurRectGM(const char name[], PaintProc pproc, U8CPU alpha) :
- fMaskFilter(SkBlurMaskFilter::Create(STROKE_WIDTH/2,
- SkBlurMaskFilter::kNormal_BlurStyle,
+ BlurRectGM(const char name[], PaintProc pproc, U8CPU alpha,
+ SkBlurMaskFilter::BlurStyle bs) :
+ fMaskFilter(SkBlurMaskFilter::Create(STROKE_WIDTH/2, bs,
SkBlurMaskFilter::kHighQuality_BlurFlag))
, fName(name)
, fPProc(pproc)
, fAlpha(SkToU8(alpha))
- {}
+ {
+ fName.appendf("_%s", gBlurStyle2Name[bs]);
+ }
protected:
virtual SkString onShortName() {
@@ -142,6 +151,10 @@
//////////////////////////////////////////////////////////////////////////////
-DEF_GM(return new BlurRectGM("blurrect", NULL, 0xFF);)
-DEF_GM(return new BlurRectGM("blurrect_grad_80", setgrad, 0x80);)
+DEF_GM(return new BlurRectGM("blurrect", NULL, 0xFF, SkBlurMaskFilter::kNormal_BlurStyle);)
+DEF_GM(return new BlurRectGM("blurrect", NULL, 0xFF, SkBlurMaskFilter::kSolid_BlurStyle);)
+DEF_GM(return new BlurRectGM("blurrect", NULL, 0xFF, SkBlurMaskFilter::kOuter_BlurStyle);)
+DEF_GM(return new BlurRectGM("blurrect", NULL, 0xFF, SkBlurMaskFilter::kInner_BlurStyle);)
+
+DEF_GM(return new BlurRectGM("blurrect_grad_80", setgrad, 0x80, SkBlurMaskFilter::kNormal_BlurStyle);)