blob: 5e31a1ca749fe2ffd110bf6580d22c3044aec0b1 [file] [log] [blame]
reed@google.comdb87c962012-11-02 21:11:12 +00001/*
humper@google.coma99a92c2013-02-20 16:42:06 +00002* Copyright 2012 Google Inc.
3*
4* Use of this source code is governed by a BSD-style license that can be
5* found in the LICENSE file.
6*/
reed@google.comdb87c962012-11-02 21:11:12 +00007
8#include "gm.h"
humper@google.com7c7292c2013-01-04 20:29:03 +00009#include "SkBlurMask.h"
robertphillips@google.comb7061172013-09-06 14:16:12 +000010#include "SkBlurMaskFilter.h"
reed@google.comdb87c962012-11-02 21:11:12 +000011#include "SkCanvas.h"
12#include "SkPath.h"
13
14#define STROKE_WIDTH SkIntToScalar(10)
15
16typedef void (*Proc)(SkCanvas*, const SkRect&, const SkPaint&);
17
18static void fill_rect(SkCanvas* canvas, const SkRect& r, const SkPaint& p) {
19 canvas->drawRect(r, p);
20}
21
reed@google.comdb87c962012-11-02 21:11:12 +000022static void draw_donut(SkCanvas* canvas, const SkRect& r, const SkPaint& p) {
23 SkRect rect;
24 SkPath path;
skia.committer@gmail.com34587162012-11-20 02:01:23 +000025
reed@google.comdb87c962012-11-02 21:11:12 +000026 rect = r;
27 rect.outset(STROKE_WIDTH/2, STROKE_WIDTH/2);
28 path.addRect(rect);
29 rect = r;
30 rect.inset(STROKE_WIDTH/2, STROKE_WIDTH/2);
skia.committer@gmail.com34587162012-11-20 02:01:23 +000031
reed@google.comdb87c962012-11-02 21:11:12 +000032 path.addRect(rect);
33 path.setFillType(SkPath::kEvenOdd_FillType);
skia.committer@gmail.com34587162012-11-20 02:01:23 +000034
reed@google.com808b70f2012-11-19 16:14:02 +000035 canvas->drawPath(path, p);
36}
reed@google.comdb87c962012-11-02 21:11:12 +000037
reed@google.com808b70f2012-11-19 16:14:02 +000038static void draw_donut_skewed(SkCanvas* canvas, const SkRect& r, const SkPaint& p) {
39 SkRect rect;
40 SkPath path;
skia.committer@gmail.com34587162012-11-20 02:01:23 +000041
reed@google.com808b70f2012-11-19 16:14:02 +000042 rect = r;
43 rect.outset(STROKE_WIDTH/2, STROKE_WIDTH/2);
44 path.addRect(rect);
45 rect = r;
46 rect.inset(STROKE_WIDTH/2, STROKE_WIDTH/2);
skia.committer@gmail.com34587162012-11-20 02:01:23 +000047
reed@google.com808b70f2012-11-19 16:14:02 +000048 rect.offset(7, -7);
skia.committer@gmail.com34587162012-11-20 02:01:23 +000049
reed@google.com808b70f2012-11-19 16:14:02 +000050 path.addRect(rect);
51 path.setFillType(SkPath::kEvenOdd_FillType);
skia.committer@gmail.com34587162012-11-20 02:01:23 +000052
reed@google.comdb87c962012-11-02 21:11:12 +000053 canvas->drawPath(path, p);
54}
55
reed@google.com53007a22012-11-26 14:39:50 +000056#include "SkGradientShader.h"
57
58typedef void (*PaintProc)(SkPaint*, SkScalar width);
59
reed@google.com57850b92012-12-17 21:20:53 +000060static const char* gBlurStyle2Name[] = {
61 "normal",
62 "solid",
63 "outer",
64 "inner"
65};
66
reed@google.comdb87c962012-11-02 21:11:12 +000067class BlurRectGM : public skiagm::GM {
humper@google.coma99a92c2013-02-20 16:42:06 +000068 SkAutoTUnref<SkMaskFilter> fMaskFilter;
69 SkString fName;
70 PaintProc fPProc;
71 SkAlpha fAlpha;
reed@google.comdb87c962012-11-02 21:11:12 +000072public:
reed@google.com57850b92012-12-17 21:20:53 +000073 BlurRectGM(const char name[], PaintProc pproc, U8CPU alpha,
skia.committer@gmail.com7bd141d2013-08-28 07:01:18 +000074 SkBlurMaskFilter::BlurStyle bs)
robertphillips@google.comb7061172013-09-06 14:16:12 +000075 : fMaskFilter(SkBlurMaskFilter::Create(bs,
76 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(STROKE_WIDTH/2)),
robertphillips@google.com7ce661d2013-08-27 16:14:03 +000077 SkBlurMaskFilter::kHighQuality_BlurFlag))
78 , fName(name)
79 , fPProc(pproc)
80 , fAlpha(SkToU8(alpha)) {
reed@google.com57850b92012-12-17 21:20:53 +000081 fName.appendf("_%s", gBlurStyle2Name[bs]);
82 }
reed@google.comdb87c962012-11-02 21:11:12 +000083
84protected:
85 virtual SkString onShortName() {
reed@google.com53007a22012-11-26 14:39:50 +000086 return fName;
reed@google.comdb87c962012-11-02 21:11:12 +000087 }
88
89 virtual SkISize onISize() {
90 return SkISize::Make(640, 480);
91 }
92
93 virtual void onDraw(SkCanvas* canvas) {
94 canvas->translate(STROKE_WIDTH*3/2, STROKE_WIDTH*3/2);
95
reed@google.com53007a22012-11-26 14:39:50 +000096 SkRect r = { 0, 0, 250, 120 };
skia.committer@gmail.com8ccf5902012-11-27 02:01:19 +000097
reed@google.comdb87c962012-11-02 21:11:12 +000098 SkPaint paint;
99 paint.setMaskFilter(fMaskFilter);
reed@google.com53007a22012-11-26 14:39:50 +0000100 if (fPProc) {
101 fPProc(&paint, r.width());
102 }
103 paint.setAlpha(fAlpha);
reed@google.comdb87c962012-11-02 21:11:12 +0000104
105 static const Proc procs[] = {
reed@google.com808b70f2012-11-19 16:14:02 +0000106 fill_rect, draw_donut, draw_donut_skewed
reed@google.comdb87c962012-11-02 21:11:12 +0000107 };
108
reed@google.comdb87c962012-11-02 21:11:12 +0000109 this->drawProcs(canvas, r, paint, false, procs, SK_ARRAY_COUNT(procs));
110 canvas->translate(r.width() * 4/3, 0);
111 this->drawProcs(canvas, r, paint, true, procs, SK_ARRAY_COUNT(procs));
112 }
113
114 virtual uint32_t onGetFlags() const { return kSkipPipe_Flag; }
115
116private:
117 void drawProcs(SkCanvas* canvas, const SkRect& r, const SkPaint& paint,
118 bool doClip, const Proc procs[], size_t procsCount) {
119 SkAutoCanvasRestore acr(canvas, true);
120 for (size_t i = 0; i < procsCount; ++i) {
121 if (doClip) {
122 SkRect clipRect(r);
123 clipRect.inset(STROKE_WIDTH/2, STROKE_WIDTH/2);
124 canvas->save();
125 canvas->clipRect(r);
126 }
127 procs[i](canvas, r, paint);
128 if (doClip) {
129 canvas->restore();
130 }
131 canvas->translate(0, r.height() * 4/3);
132 }
133 }
humper@google.coma99a92c2013-02-20 16:42:06 +0000134private:
reed@google.comdb87c962012-11-02 21:11:12 +0000135 typedef GM INHERITED;
136};
137
humper@google.com7c7292c2013-01-04 20:29:03 +0000138class BlurRectCompareGM : public skiagm::GM {
139 SkString fName;
140 unsigned int fRectWidth, fRectHeight;
reed@google.com140d7282013-01-07 20:25:04 +0000141 SkScalar fRadius;
humper@google.coma99a92c2013-02-20 16:42:06 +0000142 SkBlurMask::Style fStyle;
humper@google.com7c7292c2013-01-04 20:29:03 +0000143public:
skia.committer@gmail.comb3ec29d2013-09-07 07:01:16 +0000144 BlurRectCompareGM(const char name[], unsigned int rectWidth,
145 unsigned int rectHeight, float radius,
robertphillips@google.comb7061172013-09-06 14:16:12 +0000146 SkBlurMask::Style style)
bsalomon@google.com33cdbde2013-01-11 20:54:44 +0000147 : fName(name)
148 , fRectWidth(rectWidth)
149 , fRectHeight(rectHeight)
150 , fRadius(radius)
robertphillips@google.comb7061172013-09-06 14:16:12 +0000151 , fStyle(style) {
152 }
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000153 int width() const {
154 return fRectWidth;
humper@google.coma99a92c2013-02-20 16:42:06 +0000155 }
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000156 int height() const {
157 return fRectHeight;
humper@google.coma99a92c2013-02-20 16:42:06 +0000158 }
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000159 SkScalar radius() const {
160 return fRadius;
humper@google.coma99a92c2013-02-20 16:42:06 +0000161 }
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000162 SkBlurMask::Style style() const {
163 return fStyle;
humper@google.coma99a92c2013-02-20 16:42:06 +0000164 }
humper@google.com7c7292c2013-01-04 20:29:03 +0000165
166protected:
167 virtual SkString onShortName() {
168 return fName;
169 }
170
171 virtual SkISize onISize() {
172 return SkISize::Make(640, 480);
173 }
skia.committer@gmail.com8ae714b2013-01-05 02:02:05 +0000174
humper@google.coma99a92c2013-02-20 16:42:06 +0000175 virtual bool makeMask(SkMask *m, const SkRect&) = 0;
humper@google.com7c7292c2013-01-04 20:29:03 +0000176
177 virtual void onDraw(SkCanvas* canvas) {
humper@google.coma99a92c2013-02-20 16:42:06 +0000178 SkRect r;
179 r.setWH(SkIntToScalar(fRectWidth), SkIntToScalar(fRectHeight));
humper@google.com7c7292c2013-01-04 20:29:03 +0000180
humper@google.coma99a92c2013-02-20 16:42:06 +0000181 SkISize canvas_size = canvas->getDeviceSize();
jvanverth@google.comd98df1a2013-02-20 19:02:34 +0000182 int center_x = (canvas_size.fWidth - (int)(r.width()))/2;
183 int center_y = (canvas_size.fHeight - (int)(r.height()))/2;
humper@google.com7c7292c2013-01-04 20:29:03 +0000184
humper@google.coma99a92c2013-02-20 16:42:06 +0000185 SkMask mask;
humper@google.com7c7292c2013-01-04 20:29:03 +0000186
humper@google.coma99a92c2013-02-20 16:42:06 +0000187 if (!this->makeMask(&mask, r)) {
188 SkPaint paint;
jvanverth@google.comd98df1a2013-02-20 19:02:34 +0000189 r.offset( SkIntToScalar(center_x), SkIntToScalar(center_y) );
humper@google.coma99a92c2013-02-20 16:42:06 +0000190 canvas->drawRect(r,paint);
191 return;
192 }
193 SkAutoMaskFreeImage amfi(mask.fImage);
194
195 SkBitmap bm;
196 bm.setConfig(SkBitmap::kA8_Config, mask.fBounds.width(), mask.fBounds.height());
197 bm.setPixels(mask.fImage);
198
199 center_x = (canvas_size.fWidth - mask.fBounds.width())/2;
200 center_y = (canvas_size.fHeight - mask.fBounds.height())/2;
201
jvanverth@google.comd98df1a2013-02-20 19:02:34 +0000202 canvas->drawBitmap(bm, SkIntToScalar(center_x), SkIntToScalar(center_y), NULL);
humper@google.com7c7292c2013-01-04 20:29:03 +0000203 }
204
205 virtual uint32_t onGetFlags() const { return kSkipPipe_Flag; }
206
207private:
208 typedef GM INHERITED;
209};
210
211class BlurRectFastGM: public BlurRectCompareGM {
212public:
robertphillips@google.com7ce661d2013-08-27 16:14:03 +0000213 BlurRectFastGM(const char name[], unsigned int rectWidth,
214 unsigned int rectHeight, float blurRadius,
humper@google.coma99a92c2013-02-20 16:42:06 +0000215 SkBlurMask::Style style) :
robertphillips@google.com7ce661d2013-08-27 16:14:03 +0000216 INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
humper@google.coma99a92c2013-02-20 16:42:06 +0000217 }
robertphillips@google.com7ce661d2013-08-27 16:14:03 +0000218
humper@google.com7c7292c2013-01-04 20:29:03 +0000219protected:
humper@google.coma99a92c2013-02-20 16:42:06 +0000220 virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
robertphillips@google.comb7061172013-09-06 14:16:12 +0000221 return SkBlurMask::BlurRect(SkBlurMask::ConvertRadiusToSigma(this->radius()),
222 m, r, this->style());
reed@google.com140d7282013-01-07 20:25:04 +0000223 }
humper@google.coma99a92c2013-02-20 16:42:06 +0000224private:
225 typedef BlurRectCompareGM INHERITED;
humper@google.com7c7292c2013-01-04 20:29:03 +0000226};
227
228class BlurRectSlowGM: public BlurRectCompareGM {
229public:
robertphillips@google.comb7061172013-09-06 14:16:12 +0000230 BlurRectSlowGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
231 float blurRadius, SkBlurMask::Style style)
232 : INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
humper@google.coma99a92c2013-02-20 16:42:06 +0000233 }
robertphillips@google.comb7061172013-09-06 14:16:12 +0000234
humper@google.com7c7292c2013-01-04 20:29:03 +0000235protected:
humper@google.coma99a92c2013-02-20 16:42:06 +0000236 virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
reed@google.com140d7282013-01-07 20:25:04 +0000237 SkMask src;
238 r.roundOut(&src.fBounds);
239 src.fBounds.offset(-src.fBounds.fLeft, -src.fBounds.fTop); // move to origin
240 src.fFormat = SkMask::kA8_Format;
241 src.fRowBytes = src.fBounds.width();
humper@google.coma99a92c2013-02-20 16:42:06 +0000242 src.fImage = SkMask::AllocImage(src.computeTotalImageSize());
bsalomon@google.com33cdbde2013-01-11 20:54:44 +0000243 SkAutoMaskFreeImage amfi(src.fImage);
humper@google.com7c7292c2013-01-04 20:29:03 +0000244
bsalomon@google.com33cdbde2013-01-11 20:54:44 +0000245 memset(src.fImage, 0xff, src.computeTotalImageSize());
humper@google.com7c7292c2013-01-04 20:29:03 +0000246
skia.committer@gmail.comb3ec29d2013-09-07 07:01:16 +0000247 return SkBlurMask::BoxBlur(m, src,
248 SkBlurMask::ConvertRadiusToSigma(this->radius()),
robertphillips@google.comb7061172013-09-06 14:16:12 +0000249 this->style(), this->getQuality());
reed@google.com140d7282013-01-07 20:25:04 +0000250 }
humper@google.coma99a92c2013-02-20 16:42:06 +0000251
252 virtual SkBlurMask::Quality getQuality() {
253 return SkBlurMask::kHigh_Quality;
254 }
255private:
256 typedef BlurRectCompareGM INHERITED;
257};
258
259class BlurRectSlowLowGM: public BlurRectSlowGM {
260public:
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000261 BlurRectSlowLowGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
robertphillips@google.comb7061172013-09-06 14:16:12 +0000262 float blurRadius, SkBlurMask::Style style)
263 : INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
humper@google.coma99a92c2013-02-20 16:42:06 +0000264 }
robertphillips@google.comb7061172013-09-06 14:16:12 +0000265
humper@google.coma99a92c2013-02-20 16:42:06 +0000266protected:
267 virtual SkBlurMask::Quality getQuality() SK_OVERRIDE {
268 return SkBlurMask::kLow_Quality;
269 }
270private:
271 typedef BlurRectSlowGM INHERITED;
272};
273
274class BlurRectGroundTruthGM: public BlurRectCompareGM {
275public:
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000276 BlurRectGroundTruthGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
robertphillips@google.comb7061172013-09-06 14:16:12 +0000277 float blurRadius, SkBlurMask::Style style)
278 : INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
humper@google.coma99a92c2013-02-20 16:42:06 +0000279 }
robertphillips@google.comb7061172013-09-06 14:16:12 +0000280
humper@google.coma99a92c2013-02-20 16:42:06 +0000281protected:
282 virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
283 SkMask src;
284 r.roundOut(&src.fBounds);
285 src.fBounds.offset(-src.fBounds.fLeft, -src.fBounds.fTop); // move to origin
286 src.fFormat = SkMask::kA8_Format;
287 src.fRowBytes = src.fBounds.width();
288 src.fImage = SkMask::AllocImage(src.computeTotalImageSize());
289 SkAutoMaskFreeImage amfi(src.fImage);
290
291 memset(src.fImage, 0xff, src.computeTotalImageSize());
292
robertphillips@google.comb7061172013-09-06 14:16:12 +0000293 return SkBlurMask::BlurGroundTruth(SkBlurMask::ConvertRadiusToSigma(this->radius()),
294 m, src, this->style());
humper@google.coma99a92c2013-02-20 16:42:06 +0000295 }
296
297 virtual SkBlurMask::Quality getQuality() {
298 return SkBlurMask::kHigh_Quality;
299 }
300private:
301 typedef BlurRectCompareGM INHERITED;
humper@google.com7c7292c2013-01-04 20:29:03 +0000302};
303
304
reed@google.comdb87c962012-11-02 21:11:12 +0000305//////////////////////////////////////////////////////////////////////////////
306
reed@google.com57850b92012-12-17 21:20:53 +0000307DEF_GM(return new BlurRectGM("blurrect", NULL, 0xFF, SkBlurMaskFilter::kNormal_BlurStyle);)
308DEF_GM(return new BlurRectGM("blurrect", NULL, 0xFF, SkBlurMaskFilter::kSolid_BlurStyle);)
309DEF_GM(return new BlurRectGM("blurrect", NULL, 0xFF, SkBlurMaskFilter::kOuter_BlurStyle);)
310DEF_GM(return new BlurRectGM("blurrect", NULL, 0xFF, SkBlurMaskFilter::kInner_BlurStyle);)
311
robertphillips@google.comb7061172013-09-06 14:16:12 +0000312static const SkScalar kBig = SkFloatToScalar(20);
313static const SkScalar kSmall = SkFloatToScalar(2);
314
humper@google.coma99a92c2013-02-20 16:42:06 +0000315// regular size rects, blurs should be small enough not to completely overlap.
reed@google.comdb87c962012-11-02 21:11:12 +0000316
robertphillips@google.comb7061172013-09-06 14:16:12 +0000317DEF_GM(return new BlurRectFastGM( "blurrect_25_100_2_normal_fast", 25, 100, kSmall, SkBlurMask::kNormal_Style);)
318DEF_GM(return new BlurRectFastGM("blurrect_25_100_20_normal_fast", 25, 100, kBig, SkBlurMask::kNormal_Style);)
319DEF_GM(return new BlurRectSlowGM( "blurrect_25_100_2_normal_slow", 25, 100, kSmall, SkBlurMask::kNormal_Style);)
320DEF_GM(return new BlurRectSlowGM("blurrect_25_100_20_normal_slow", 25, 100, kBig, SkBlurMask::kNormal_Style);)
321DEF_GM(return new BlurRectFastGM( "blurrect_25_100_2_inner_fast", 25, 100, kSmall, SkBlurMask::kInner_Style);)
322DEF_GM(return new BlurRectFastGM("blurrect_25_100_20_inner_fast", 25, 100, kBig, SkBlurMask::kInner_Style);)
323DEF_GM(return new BlurRectSlowGM( "blurrect_25_100_2_inner_slow", 25, 100, kSmall, SkBlurMask::kInner_Style);)
324DEF_GM(return new BlurRectSlowGM("blurrect_25_100_20_inner_slow", 25, 100, kBig, SkBlurMask::kInner_Style);)
325DEF_GM(return new BlurRectFastGM( "blurrect_25_100_2_outer_fast", 25, 100, kSmall, SkBlurMask::kOuter_Style);)
326DEF_GM(return new BlurRectFastGM("blurrect_25_100_20_outer_fast", 25, 100, kBig, SkBlurMask::kOuter_Style);)
327DEF_GM(return new BlurRectSlowGM( "blurrect_25_100_2_outer_slow", 25, 100, kSmall, SkBlurMask::kOuter_Style);)
328DEF_GM(return new BlurRectSlowGM("blurrect_25_100_20_outer_slow", 25, 100, kBig, SkBlurMask::kOuter_Style);)
humper@google.coma99a92c2013-02-20 16:42:06 +0000329
330// skinny tall rects, blurs overlap in X but not y
331
robertphillips@google.comb7061172013-09-06 14:16:12 +0000332DEF_GM(return new BlurRectFastGM( "blurrect_5_100_2_normal_fast", 5, 100, kSmall, SkBlurMask::kNormal_Style);)
333DEF_GM(return new BlurRectFastGM("blurrect_5_100_20_normal_fast", 5, 100, kBig, SkBlurMask::kNormal_Style);)
334DEF_GM(return new BlurRectSlowGM( "blurrect_5_100_2_normal_slow", 5, 100, kSmall, SkBlurMask::kNormal_Style);)
335DEF_GM(return new BlurRectSlowGM("blurrect_5_100_20_normal_slow", 5, 100, kBig, SkBlurMask::kNormal_Style);)
336DEF_GM(return new BlurRectFastGM( "blurrect_5_100_2_inner_fast", 5, 100, kSmall, SkBlurMask::kInner_Style);)
337DEF_GM(return new BlurRectFastGM("blurrect_5_100_20_inner_fast", 5, 100, kBig, SkBlurMask::kInner_Style);)
338DEF_GM(return new BlurRectSlowGM( "blurrect_5_100_2_inner_slow", 5, 100, kSmall, SkBlurMask::kInner_Style);)
339DEF_GM(return new BlurRectSlowGM("blurrect_5_100_20_inner_slow", 5, 100, kBig, SkBlurMask::kInner_Style);)
340DEF_GM(return new BlurRectFastGM( "blurrect_5_100_2_outer_fast", 5, 100, kSmall, SkBlurMask::kOuter_Style);)
341DEF_GM(return new BlurRectFastGM("blurrect_5_100_20_outer_fast", 5, 100, kBig, SkBlurMask::kOuter_Style);)
342DEF_GM(return new BlurRectSlowGM( "blurrect_5_100_2_outer_slow", 5, 100, kSmall, SkBlurMask::kOuter_Style);)
343DEF_GM(return new BlurRectSlowGM("blurrect_5_100_20_outer_slow", 5, 100, kBig, SkBlurMask::kOuter_Style);)
humper@google.coma99a92c2013-02-20 16:42:06 +0000344
345// tiny rects, blurs overlap in X and Y
346
robertphillips@google.comb7061172013-09-06 14:16:12 +0000347DEF_GM(return new BlurRectFastGM( "blurrect_5_5_2_normal_fast", 5, 5, kSmall, SkBlurMask::kNormal_Style);)
348DEF_GM(return new BlurRectFastGM("blurrect_5_5_20_normal_fast", 5, 5, kBig, SkBlurMask::kNormal_Style);)
349DEF_GM(return new BlurRectSlowGM( "blurrect_5_5_2_normal_slow", 5, 5, kSmall, SkBlurMask::kNormal_Style);)
350DEF_GM(return new BlurRectSlowGM("blurrect_5_5_20_normal_slow", 5, 5, kBig, SkBlurMask::kNormal_Style);)
351DEF_GM(return new BlurRectFastGM( "blurrect_5_5_2_inner_fast", 5, 5, kSmall, SkBlurMask::kInner_Style);)
352DEF_GM(return new BlurRectFastGM("blurrect_5_5_20_inner_fast", 5, 5, kBig, SkBlurMask::kInner_Style);)
353DEF_GM(return new BlurRectSlowGM( "blurrect_5_5_2_inner_slow", 5, 5, kSmall, SkBlurMask::kInner_Style);)
354DEF_GM(return new BlurRectSlowGM("blurrect_5_5_20_inner_slow", 5, 5, kBig, SkBlurMask::kInner_Style);)
355DEF_GM(return new BlurRectFastGM( "blurrect_5_5_2_outer_fast", 5, 5, kSmall, SkBlurMask::kOuter_Style);)
356DEF_GM(return new BlurRectFastGM("blurrect_5_5_20_outer_fast", 5, 5, kBig, SkBlurMask::kOuter_Style);)
357DEF_GM(return new BlurRectSlowGM( "blurrect_5_5_2_outer_slow", 5, 5, kSmall, SkBlurMask::kOuter_Style);)
358DEF_GM(return new BlurRectSlowGM("blurrect_5_5_20_outer_slow", 5, 5, kBig, SkBlurMask::kOuter_Style);)
humper@google.coma99a92c2013-02-20 16:42:06 +0000359
360
361#if 0
362// dont' need to GM the gaussian convolution; it's slow and intended
363// as a ground truth comparison only. Leaving these here in case we
364// ever want to turn these back on for debugging reasons.
365DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_1_simple", 25, 100, 1);)
366DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_2_simple", 25, 100, 2);)
367DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_3_simple", 25, 100, 3);)
368DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_4_simple", 25, 100, 4);)
369DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_5_simple", 25, 100, 5);)
370DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_6_simple", 25, 100, 6);)
371DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_7_simple", 25, 100, 7);)
372DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_8_simple", 25, 100, 8);)
373DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_9_simple", 25, 100, 9);)
374DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_10_simple", 25, 100, 10);)
375DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_11_simple", 25, 100, 11);)
376DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_12_simple", 25, 100, 12);)
377DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_13_simple", 25, 100, 13);)
378DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_14_simple", 25, 100, 14);)
379DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_15_simple", 25, 100, 15);)
380DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_16_simple", 25, 100, 16);)
381DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_17_simple", 25, 100, 17);)
382DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_18_simple", 25, 100, 18);)
383DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_19_simple", 25, 100, 19);)
384#endif