aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-17 21:20:53 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-17 21:20:53 +0000
commit57850b9daddd941f880d94faaf83f2169355a0c8 (patch)
tree4576c87dce1f43004206821974abcf78a576fed0 /gm
parent5f74cf8c49701f514b69dc6f1a8b5c0ffd78af0a (diff)
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
Diffstat (limited to 'gm')
-rw-r--r--gm/blurrect.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/gm/blurrect.cpp b/gm/blurrect.cpp
index 3d9a33aa71..c28468acf9 100644
--- a/gm/blurrect.cpp
+++ b/gm/blurrect.cpp
@@ -71,20 +71,29 @@ static void setgrad(SkPaint* paint, SkScalar width) {
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 @@ private:
//////////////////////////////////////////////////////////////////////////////
-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);)