blob: 3197eb6fc6a51c686b3d6241d2a510d18157c005 [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.comdb87c962012-11-02 21:11:12 +000060class BlurRectGM : public skiagm::GM {
commit-bot@chromium.org7cced562014-01-10 23:10:13 +000061 SkAutoTUnref<SkMaskFilter> fMaskFilters[SkBlurMaskFilter::kBlurStyleCount];
humper@google.coma99a92c2013-02-20 16:42:06 +000062 SkString fName;
humper@google.coma99a92c2013-02-20 16:42:06 +000063 SkAlpha fAlpha;
reed@google.comdb87c962012-11-02 21:11:12 +000064public:
commit-bot@chromium.org7cced562014-01-10 23:10:13 +000065 BlurRectGM(const char name[], U8CPU alpha)
66 : fName(name)
67 , fAlpha(SkToU8(alpha)) {
reed@google.com57850b92012-12-17 21:20:53 +000068 }
reed@google.comdb87c962012-11-02 21:11:12 +000069
70protected:
commit-bot@chromium.org7cced562014-01-10 23:10:13 +000071 virtual void onOnceBeforeDraw() SK_OVERRIDE {
72 for (int i = 0; i < SkBlurMaskFilter::kBlurStyleCount; ++i) {
73 fMaskFilters[i].reset(SkBlurMaskFilter::Create((SkBlurMaskFilter::BlurStyle) i,
74 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(STROKE_WIDTH/2)),
75 SkBlurMaskFilter::kHighQuality_BlurFlag));
76 }
77 }
78
reed@google.comdb87c962012-11-02 21:11:12 +000079 virtual SkString onShortName() {
reed@google.com53007a22012-11-26 14:39:50 +000080 return fName;
reed@google.comdb87c962012-11-02 21:11:12 +000081 }
82
83 virtual SkISize onISize() {
commit-bot@chromium.org7cced562014-01-10 23:10:13 +000084 return SkISize::Make(440, 820);
reed@google.comdb87c962012-11-02 21:11:12 +000085 }
86
87 virtual void onDraw(SkCanvas* canvas) {
88 canvas->translate(STROKE_WIDTH*3/2, STROKE_WIDTH*3/2);
89
commit-bot@chromium.org7cced562014-01-10 23:10:13 +000090 SkRect r = { 0, 0, 100, 50 };
91 SkScalar scales[] = { SK_Scalar1, 0.6f };
skia.committer@gmail.com8ccf5902012-11-27 02:01:19 +000092
commit-bot@chromium.org7cced562014-01-10 23:10:13 +000093 for (size_t s = 0; s < SK_ARRAY_COUNT(scales); ++s) {
94 canvas->save();
95 for (size_t f = 0; f < SK_ARRAY_COUNT(fMaskFilters); ++f) {
96 SkPaint paint;
97 paint.setMaskFilter(fMaskFilters[f]);
98 paint.setAlpha(fAlpha);
99
100 static const Proc procs[] = {
101 fill_rect, draw_donut, draw_donut_skewed
102 };
103
104 canvas->save();
105 canvas->scale(scales[s], scales[s]);
106 this->drawProcs(canvas, r, paint, false, procs, SK_ARRAY_COUNT(procs));
107 canvas->translate(r.width() * 4/3, 0);
108 this->drawProcs(canvas, r, paint, true, procs, SK_ARRAY_COUNT(procs));
109 canvas->restore();
110
111 canvas->translate(0, SK_ARRAY_COUNT(procs) * r.height() * 4/3 * scales[s]);
112 }
113 canvas->restore();
114 canvas->translate(2 * r.width() * 4/3 * scales[s], 0);
reed@google.com53007a22012-11-26 14:39:50 +0000115 }
reed@google.comdb87c962012-11-02 21:11:12 +0000116 }
117
118 virtual uint32_t onGetFlags() const { return kSkipPipe_Flag; }
119
120private:
121 void drawProcs(SkCanvas* canvas, const SkRect& r, const SkPaint& paint,
122 bool doClip, const Proc procs[], size_t procsCount) {
123 SkAutoCanvasRestore acr(canvas, true);
124 for (size_t i = 0; i < procsCount; ++i) {
125 if (doClip) {
126 SkRect clipRect(r);
127 clipRect.inset(STROKE_WIDTH/2, STROKE_WIDTH/2);
128 canvas->save();
129 canvas->clipRect(r);
130 }
131 procs[i](canvas, r, paint);
132 if (doClip) {
133 canvas->restore();
134 }
135 canvas->translate(0, r.height() * 4/3);
136 }
137 }
humper@google.coma99a92c2013-02-20 16:42:06 +0000138private:
reed@google.comdb87c962012-11-02 21:11:12 +0000139 typedef GM INHERITED;
140};
141
humper@google.com7c7292c2013-01-04 20:29:03 +0000142class BlurRectCompareGM : public skiagm::GM {
143 SkString fName;
144 unsigned int fRectWidth, fRectHeight;
reed@google.com140d7282013-01-07 20:25:04 +0000145 SkScalar fRadius;
humper@google.coma99a92c2013-02-20 16:42:06 +0000146 SkBlurMask::Style fStyle;
humper@google.com7c7292c2013-01-04 20:29:03 +0000147public:
skia.committer@gmail.comb3ec29d2013-09-07 07:01:16 +0000148 BlurRectCompareGM(const char name[], unsigned int rectWidth,
149 unsigned int rectHeight, float radius,
robertphillips@google.comb7061172013-09-06 14:16:12 +0000150 SkBlurMask::Style style)
bsalomon@google.com33cdbde2013-01-11 20:54:44 +0000151 : fName(name)
152 , fRectWidth(rectWidth)
153 , fRectHeight(rectHeight)
154 , fRadius(radius)
robertphillips@google.comb7061172013-09-06 14:16:12 +0000155 , fStyle(style) {
156 }
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000157 int width() const {
158 return fRectWidth;
humper@google.coma99a92c2013-02-20 16:42:06 +0000159 }
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000160 int height() const {
161 return fRectHeight;
humper@google.coma99a92c2013-02-20 16:42:06 +0000162 }
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000163 SkScalar radius() const {
164 return fRadius;
humper@google.coma99a92c2013-02-20 16:42:06 +0000165 }
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000166 SkBlurMask::Style style() const {
167 return fStyle;
humper@google.coma99a92c2013-02-20 16:42:06 +0000168 }
humper@google.com7c7292c2013-01-04 20:29:03 +0000169
170protected:
171 virtual SkString onShortName() {
172 return fName;
173 }
174
175 virtual SkISize onISize() {
176 return SkISize::Make(640, 480);
177 }
skia.committer@gmail.com8ae714b2013-01-05 02:02:05 +0000178
humper@google.coma99a92c2013-02-20 16:42:06 +0000179 virtual bool makeMask(SkMask *m, const SkRect&) = 0;
humper@google.com7c7292c2013-01-04 20:29:03 +0000180
181 virtual void onDraw(SkCanvas* canvas) {
humper@google.coma99a92c2013-02-20 16:42:06 +0000182 SkRect r;
183 r.setWH(SkIntToScalar(fRectWidth), SkIntToScalar(fRectHeight));
humper@google.com7c7292c2013-01-04 20:29:03 +0000184
humper@google.coma99a92c2013-02-20 16:42:06 +0000185 SkISize canvas_size = canvas->getDeviceSize();
jvanverth@google.comd98df1a2013-02-20 19:02:34 +0000186 int center_x = (canvas_size.fWidth - (int)(r.width()))/2;
187 int center_y = (canvas_size.fHeight - (int)(r.height()))/2;
humper@google.com7c7292c2013-01-04 20:29:03 +0000188
humper@google.coma99a92c2013-02-20 16:42:06 +0000189 SkMask mask;
humper@google.com7c7292c2013-01-04 20:29:03 +0000190
humper@google.coma99a92c2013-02-20 16:42:06 +0000191 if (!this->makeMask(&mask, r)) {
192 SkPaint paint;
jvanverth@google.comd98df1a2013-02-20 19:02:34 +0000193 r.offset( SkIntToScalar(center_x), SkIntToScalar(center_y) );
humper@google.coma99a92c2013-02-20 16:42:06 +0000194 canvas->drawRect(r,paint);
195 return;
196 }
197 SkAutoMaskFreeImage amfi(mask.fImage);
198
199 SkBitmap bm;
200 bm.setConfig(SkBitmap::kA8_Config, mask.fBounds.width(), mask.fBounds.height());
201 bm.setPixels(mask.fImage);
202
203 center_x = (canvas_size.fWidth - mask.fBounds.width())/2;
204 center_y = (canvas_size.fHeight - mask.fBounds.height())/2;
205
jvanverth@google.comd98df1a2013-02-20 19:02:34 +0000206 canvas->drawBitmap(bm, SkIntToScalar(center_x), SkIntToScalar(center_y), NULL);
humper@google.com7c7292c2013-01-04 20:29:03 +0000207 }
208
209 virtual uint32_t onGetFlags() const { return kSkipPipe_Flag; }
210
211private:
212 typedef GM INHERITED;
213};
214
215class BlurRectFastGM: public BlurRectCompareGM {
216public:
robertphillips@google.com7ce661d2013-08-27 16:14:03 +0000217 BlurRectFastGM(const char name[], unsigned int rectWidth,
218 unsigned int rectHeight, float blurRadius,
humper@google.coma99a92c2013-02-20 16:42:06 +0000219 SkBlurMask::Style style) :
robertphillips@google.com7ce661d2013-08-27 16:14:03 +0000220 INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
humper@google.coma99a92c2013-02-20 16:42:06 +0000221 }
robertphillips@google.com7ce661d2013-08-27 16:14:03 +0000222
humper@google.com7c7292c2013-01-04 20:29:03 +0000223protected:
humper@google.coma99a92c2013-02-20 16:42:06 +0000224 virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
robertphillips@google.comb7061172013-09-06 14:16:12 +0000225 return SkBlurMask::BlurRect(SkBlurMask::ConvertRadiusToSigma(this->radius()),
226 m, r, this->style());
reed@google.com140d7282013-01-07 20:25:04 +0000227 }
humper@google.coma99a92c2013-02-20 16:42:06 +0000228private:
229 typedef BlurRectCompareGM INHERITED;
humper@google.com7c7292c2013-01-04 20:29:03 +0000230};
231
232class BlurRectSlowGM: public BlurRectCompareGM {
233public:
robertphillips@google.comb7061172013-09-06 14:16:12 +0000234 BlurRectSlowGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
235 float blurRadius, SkBlurMask::Style style)
236 : INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
humper@google.coma99a92c2013-02-20 16:42:06 +0000237 }
robertphillips@google.comb7061172013-09-06 14:16:12 +0000238
humper@google.com7c7292c2013-01-04 20:29:03 +0000239protected:
humper@google.coma99a92c2013-02-20 16:42:06 +0000240 virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
reed@google.com140d7282013-01-07 20:25:04 +0000241 SkMask src;
242 r.roundOut(&src.fBounds);
243 src.fBounds.offset(-src.fBounds.fLeft, -src.fBounds.fTop); // move to origin
244 src.fFormat = SkMask::kA8_Format;
245 src.fRowBytes = src.fBounds.width();
humper@google.coma99a92c2013-02-20 16:42:06 +0000246 src.fImage = SkMask::AllocImage(src.computeTotalImageSize());
bsalomon@google.com33cdbde2013-01-11 20:54:44 +0000247 SkAutoMaskFreeImage amfi(src.fImage);
humper@google.com7c7292c2013-01-04 20:29:03 +0000248
bsalomon@google.com33cdbde2013-01-11 20:54:44 +0000249 memset(src.fImage, 0xff, src.computeTotalImageSize());
humper@google.com7c7292c2013-01-04 20:29:03 +0000250
skia.committer@gmail.comb3ec29d2013-09-07 07:01:16 +0000251 return SkBlurMask::BoxBlur(m, src,
252 SkBlurMask::ConvertRadiusToSigma(this->radius()),
robertphillips@google.comb7061172013-09-06 14:16:12 +0000253 this->style(), this->getQuality());
reed@google.com140d7282013-01-07 20:25:04 +0000254 }
humper@google.coma99a92c2013-02-20 16:42:06 +0000255
256 virtual SkBlurMask::Quality getQuality() {
257 return SkBlurMask::kHigh_Quality;
258 }
259private:
260 typedef BlurRectCompareGM INHERITED;
261};
262
263class BlurRectSlowLowGM: public BlurRectSlowGM {
264public:
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000265 BlurRectSlowLowGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
robertphillips@google.comb7061172013-09-06 14:16:12 +0000266 float blurRadius, SkBlurMask::Style style)
267 : INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
humper@google.coma99a92c2013-02-20 16:42:06 +0000268 }
robertphillips@google.comb7061172013-09-06 14:16:12 +0000269
humper@google.coma99a92c2013-02-20 16:42:06 +0000270protected:
271 virtual SkBlurMask::Quality getQuality() SK_OVERRIDE {
272 return SkBlurMask::kLow_Quality;
273 }
274private:
275 typedef BlurRectSlowGM INHERITED;
276};
277
278class BlurRectGroundTruthGM: public BlurRectCompareGM {
279public:
skia.committer@gmail.comd454ec12013-02-21 07:15:03 +0000280 BlurRectGroundTruthGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
robertphillips@google.comb7061172013-09-06 14:16:12 +0000281 float blurRadius, SkBlurMask::Style style)
282 : INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
humper@google.coma99a92c2013-02-20 16:42:06 +0000283 }
robertphillips@google.comb7061172013-09-06 14:16:12 +0000284
humper@google.coma99a92c2013-02-20 16:42:06 +0000285protected:
286 virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
287 SkMask src;
288 r.roundOut(&src.fBounds);
289 src.fBounds.offset(-src.fBounds.fLeft, -src.fBounds.fTop); // move to origin
290 src.fFormat = SkMask::kA8_Format;
291 src.fRowBytes = src.fBounds.width();
292 src.fImage = SkMask::AllocImage(src.computeTotalImageSize());
293 SkAutoMaskFreeImage amfi(src.fImage);
294
295 memset(src.fImage, 0xff, src.computeTotalImageSize());
296
robertphillips@google.comb7061172013-09-06 14:16:12 +0000297 return SkBlurMask::BlurGroundTruth(SkBlurMask::ConvertRadiusToSigma(this->radius()),
298 m, src, this->style());
humper@google.coma99a92c2013-02-20 16:42:06 +0000299 }
300
301 virtual SkBlurMask::Quality getQuality() {
302 return SkBlurMask::kHigh_Quality;
303 }
304private:
305 typedef BlurRectCompareGM INHERITED;
humper@google.com7c7292c2013-01-04 20:29:03 +0000306};
307
308
reed@google.comdb87c962012-11-02 21:11:12 +0000309//////////////////////////////////////////////////////////////////////////////
310
commit-bot@chromium.org7cced562014-01-10 23:10:13 +0000311DEF_GM(return new BlurRectGM("blurrects", 0xFF);)
reed@google.com57850b92012-12-17 21:20:53 +0000312
commit-bot@chromium.org4b413c82013-11-25 19:44:07 +0000313static const SkScalar kBig = 20;
314static const SkScalar kSmall = 2;
robertphillips@google.comb7061172013-09-06 14:16:12 +0000315
humper@google.coma99a92c2013-02-20 16:42:06 +0000316// regular size rects, blurs should be small enough not to completely overlap.
reed@google.comdb87c962012-11-02 21:11:12 +0000317
robertphillips@google.comb7061172013-09-06 14:16:12 +0000318DEF_GM(return new BlurRectFastGM( "blurrect_25_100_2_normal_fast", 25, 100, kSmall, SkBlurMask::kNormal_Style);)
319DEF_GM(return new BlurRectFastGM("blurrect_25_100_20_normal_fast", 25, 100, kBig, SkBlurMask::kNormal_Style);)
320DEF_GM(return new BlurRectSlowGM( "blurrect_25_100_2_normal_slow", 25, 100, kSmall, SkBlurMask::kNormal_Style);)
321DEF_GM(return new BlurRectSlowGM("blurrect_25_100_20_normal_slow", 25, 100, kBig, SkBlurMask::kNormal_Style);)
322DEF_GM(return new BlurRectFastGM( "blurrect_25_100_2_inner_fast", 25, 100, kSmall, SkBlurMask::kInner_Style);)
323DEF_GM(return new BlurRectFastGM("blurrect_25_100_20_inner_fast", 25, 100, kBig, SkBlurMask::kInner_Style);)
324DEF_GM(return new BlurRectSlowGM( "blurrect_25_100_2_inner_slow", 25, 100, kSmall, SkBlurMask::kInner_Style);)
325DEF_GM(return new BlurRectSlowGM("blurrect_25_100_20_inner_slow", 25, 100, kBig, SkBlurMask::kInner_Style);)
326DEF_GM(return new BlurRectFastGM( "blurrect_25_100_2_outer_fast", 25, 100, kSmall, SkBlurMask::kOuter_Style);)
327DEF_GM(return new BlurRectFastGM("blurrect_25_100_20_outer_fast", 25, 100, kBig, SkBlurMask::kOuter_Style);)
328DEF_GM(return new BlurRectSlowGM( "blurrect_25_100_2_outer_slow", 25, 100, kSmall, SkBlurMask::kOuter_Style);)
329DEF_GM(return new BlurRectSlowGM("blurrect_25_100_20_outer_slow", 25, 100, kBig, SkBlurMask::kOuter_Style);)
humper@google.coma99a92c2013-02-20 16:42:06 +0000330
331// skinny tall rects, blurs overlap in X but not y
332
robertphillips@google.comb7061172013-09-06 14:16:12 +0000333DEF_GM(return new BlurRectFastGM( "blurrect_5_100_2_normal_fast", 5, 100, kSmall, SkBlurMask::kNormal_Style);)
334DEF_GM(return new BlurRectFastGM("blurrect_5_100_20_normal_fast", 5, 100, kBig, SkBlurMask::kNormal_Style);)
335DEF_GM(return new BlurRectSlowGM( "blurrect_5_100_2_normal_slow", 5, 100, kSmall, SkBlurMask::kNormal_Style);)
336DEF_GM(return new BlurRectSlowGM("blurrect_5_100_20_normal_slow", 5, 100, kBig, SkBlurMask::kNormal_Style);)
337DEF_GM(return new BlurRectFastGM( "blurrect_5_100_2_inner_fast", 5, 100, kSmall, SkBlurMask::kInner_Style);)
338DEF_GM(return new BlurRectFastGM("blurrect_5_100_20_inner_fast", 5, 100, kBig, SkBlurMask::kInner_Style);)
339DEF_GM(return new BlurRectSlowGM( "blurrect_5_100_2_inner_slow", 5, 100, kSmall, SkBlurMask::kInner_Style);)
340DEF_GM(return new BlurRectSlowGM("blurrect_5_100_20_inner_slow", 5, 100, kBig, SkBlurMask::kInner_Style);)
341DEF_GM(return new BlurRectFastGM( "blurrect_5_100_2_outer_fast", 5, 100, kSmall, SkBlurMask::kOuter_Style);)
342DEF_GM(return new BlurRectFastGM("blurrect_5_100_20_outer_fast", 5, 100, kBig, SkBlurMask::kOuter_Style);)
343DEF_GM(return new BlurRectSlowGM( "blurrect_5_100_2_outer_slow", 5, 100, kSmall, SkBlurMask::kOuter_Style);)
344DEF_GM(return new BlurRectSlowGM("blurrect_5_100_20_outer_slow", 5, 100, kBig, SkBlurMask::kOuter_Style);)
humper@google.coma99a92c2013-02-20 16:42:06 +0000345
346// tiny rects, blurs overlap in X and Y
347
robertphillips@google.comb7061172013-09-06 14:16:12 +0000348DEF_GM(return new BlurRectFastGM( "blurrect_5_5_2_normal_fast", 5, 5, kSmall, SkBlurMask::kNormal_Style);)
349DEF_GM(return new BlurRectFastGM("blurrect_5_5_20_normal_fast", 5, 5, kBig, SkBlurMask::kNormal_Style);)
350DEF_GM(return new BlurRectSlowGM( "blurrect_5_5_2_normal_slow", 5, 5, kSmall, SkBlurMask::kNormal_Style);)
351DEF_GM(return new BlurRectSlowGM("blurrect_5_5_20_normal_slow", 5, 5, kBig, SkBlurMask::kNormal_Style);)
352DEF_GM(return new BlurRectFastGM( "blurrect_5_5_2_inner_fast", 5, 5, kSmall, SkBlurMask::kInner_Style);)
353DEF_GM(return new BlurRectFastGM("blurrect_5_5_20_inner_fast", 5, 5, kBig, SkBlurMask::kInner_Style);)
354DEF_GM(return new BlurRectSlowGM( "blurrect_5_5_2_inner_slow", 5, 5, kSmall, SkBlurMask::kInner_Style);)
355DEF_GM(return new BlurRectSlowGM("blurrect_5_5_20_inner_slow", 5, 5, kBig, SkBlurMask::kInner_Style);)
356DEF_GM(return new BlurRectFastGM( "blurrect_5_5_2_outer_fast", 5, 5, kSmall, SkBlurMask::kOuter_Style);)
357DEF_GM(return new BlurRectFastGM("blurrect_5_5_20_outer_fast", 5, 5, kBig, SkBlurMask::kOuter_Style);)
358DEF_GM(return new BlurRectSlowGM( "blurrect_5_5_2_outer_slow", 5, 5, kSmall, SkBlurMask::kOuter_Style);)
359DEF_GM(return new BlurRectSlowGM("blurrect_5_5_20_outer_slow", 5, 5, kBig, SkBlurMask::kOuter_Style);)
humper@google.coma99a92c2013-02-20 16:42:06 +0000360
361
362#if 0
363// dont' need to GM the gaussian convolution; it's slow and intended
364// as a ground truth comparison only. Leaving these here in case we
365// ever want to turn these back on for debugging reasons.
366DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_1_simple", 25, 100, 1);)
367DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_2_simple", 25, 100, 2);)
368DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_3_simple", 25, 100, 3);)
369DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_4_simple", 25, 100, 4);)
370DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_5_simple", 25, 100, 5);)
371DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_6_simple", 25, 100, 6);)
372DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_7_simple", 25, 100, 7);)
373DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_8_simple", 25, 100, 8);)
374DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_9_simple", 25, 100, 9);)
375DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_10_simple", 25, 100, 10);)
376DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_11_simple", 25, 100, 11);)
377DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_12_simple", 25, 100, 12);)
378DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_13_simple", 25, 100, 13);)
379DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_14_simple", 25, 100, 14);)
380DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_15_simple", 25, 100, 15);)
381DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_16_simple", 25, 100, 16);)
382DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_17_simple", 25, 100, 17);)
383DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_18_simple", 25, 100, 18);)
384DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_19_simple", 25, 100, 19);)
385#endif