2012-11-02 21:11:12 +00:00
|
|
|
/*
|
2013-02-20 16:42:06 +00:00
|
|
|
* Copyright 2012 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2012-11-02 21:11:12 +00:00
|
|
|
|
|
|
|
#include "gm.h"
|
2013-01-04 20:29:03 +00:00
|
|
|
#include "SkBlurMask.h"
|
2013-09-06 14:16:12 +00:00
|
|
|
#include "SkBlurMaskFilter.h"
|
2012-11-02 21:11:12 +00:00
|
|
|
#include "SkCanvas.h"
|
|
|
|
#include "SkPath.h"
|
|
|
|
|
|
|
|
#define STROKE_WIDTH SkIntToScalar(10)
|
|
|
|
|
|
|
|
typedef void (*Proc)(SkCanvas*, const SkRect&, const SkPaint&);
|
|
|
|
|
|
|
|
static void fill_rect(SkCanvas* canvas, const SkRect& r, const SkPaint& p) {
|
|
|
|
canvas->drawRect(r, p);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void draw_donut(SkCanvas* canvas, const SkRect& r, const SkPaint& p) {
|
|
|
|
SkRect rect;
|
|
|
|
SkPath path;
|
2012-11-20 02:01:23 +00:00
|
|
|
|
2012-11-02 21:11:12 +00:00
|
|
|
rect = r;
|
|
|
|
rect.outset(STROKE_WIDTH/2, STROKE_WIDTH/2);
|
|
|
|
path.addRect(rect);
|
|
|
|
rect = r;
|
|
|
|
rect.inset(STROKE_WIDTH/2, STROKE_WIDTH/2);
|
2012-11-20 02:01:23 +00:00
|
|
|
|
2012-11-02 21:11:12 +00:00
|
|
|
path.addRect(rect);
|
|
|
|
path.setFillType(SkPath::kEvenOdd_FillType);
|
2012-11-20 02:01:23 +00:00
|
|
|
|
2012-11-19 16:14:02 +00:00
|
|
|
canvas->drawPath(path, p);
|
|
|
|
}
|
2012-11-02 21:11:12 +00:00
|
|
|
|
2012-11-19 16:14:02 +00:00
|
|
|
static void draw_donut_skewed(SkCanvas* canvas, const SkRect& r, const SkPaint& p) {
|
|
|
|
SkRect rect;
|
|
|
|
SkPath path;
|
2012-11-20 02:01:23 +00:00
|
|
|
|
2012-11-19 16:14:02 +00:00
|
|
|
rect = r;
|
|
|
|
rect.outset(STROKE_WIDTH/2, STROKE_WIDTH/2);
|
|
|
|
path.addRect(rect);
|
|
|
|
rect = r;
|
|
|
|
rect.inset(STROKE_WIDTH/2, STROKE_WIDTH/2);
|
2012-11-20 02:01:23 +00:00
|
|
|
|
2012-11-19 16:14:02 +00:00
|
|
|
rect.offset(7, -7);
|
2012-11-20 02:01:23 +00:00
|
|
|
|
2012-11-19 16:14:02 +00:00
|
|
|
path.addRect(rect);
|
|
|
|
path.setFillType(SkPath::kEvenOdd_FillType);
|
2012-11-20 02:01:23 +00:00
|
|
|
|
2012-11-02 21:11:12 +00:00
|
|
|
canvas->drawPath(path, p);
|
|
|
|
}
|
|
|
|
|
2012-11-26 14:39:50 +00:00
|
|
|
#include "SkGradientShader.h"
|
|
|
|
|
|
|
|
typedef void (*PaintProc)(SkPaint*, SkScalar width);
|
|
|
|
|
2012-11-02 21:11:12 +00:00
|
|
|
class BlurRectGM : public skiagm::GM {
|
2014-04-28 16:25:35 +00:00
|
|
|
SkAutoTUnref<SkMaskFilter> fMaskFilters[kLastEnum_SkBlurStyle + 1];
|
2013-02-20 16:42:06 +00:00
|
|
|
SkString fName;
|
|
|
|
SkAlpha fAlpha;
|
2012-11-02 21:11:12 +00:00
|
|
|
public:
|
2014-01-10 23:10:13 +00:00
|
|
|
BlurRectGM(const char name[], U8CPU alpha)
|
|
|
|
: fName(name)
|
|
|
|
, fAlpha(SkToU8(alpha)) {
|
2012-12-17 21:20:53 +00:00
|
|
|
}
|
2012-11-02 21:11:12 +00:00
|
|
|
|
|
|
|
protected:
|
2014-01-10 23:10:13 +00:00
|
|
|
virtual void onOnceBeforeDraw() SK_OVERRIDE {
|
2014-04-28 16:25:35 +00:00
|
|
|
for (int i = 0; i <= kLastEnum_SkBlurStyle; ++i) {
|
|
|
|
fMaskFilters[i].reset(SkBlurMaskFilter::Create((SkBlurStyle)i,
|
2014-01-10 23:10:13 +00:00
|
|
|
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(STROKE_WIDTH/2)),
|
|
|
|
SkBlurMaskFilter::kHighQuality_BlurFlag));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-02 21:11:12 +00:00
|
|
|
virtual SkString onShortName() {
|
2012-11-26 14:39:50 +00:00
|
|
|
return fName;
|
2012-11-02 21:11:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual SkISize onISize() {
|
2014-01-10 23:10:13 +00:00
|
|
|
return SkISize::Make(440, 820);
|
2012-11-02 21:11:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual void onDraw(SkCanvas* canvas) {
|
|
|
|
canvas->translate(STROKE_WIDTH*3/2, STROKE_WIDTH*3/2);
|
|
|
|
|
2014-01-10 23:10:13 +00:00
|
|
|
SkRect r = { 0, 0, 100, 50 };
|
|
|
|
SkScalar scales[] = { SK_Scalar1, 0.6f };
|
2012-11-27 02:01:19 +00:00
|
|
|
|
2014-01-10 23:10:13 +00:00
|
|
|
for (size_t s = 0; s < SK_ARRAY_COUNT(scales); ++s) {
|
|
|
|
canvas->save();
|
|
|
|
for (size_t f = 0; f < SK_ARRAY_COUNT(fMaskFilters); ++f) {
|
|
|
|
SkPaint paint;
|
|
|
|
paint.setMaskFilter(fMaskFilters[f]);
|
|
|
|
paint.setAlpha(fAlpha);
|
|
|
|
|
|
|
|
static const Proc procs[] = {
|
|
|
|
fill_rect, draw_donut, draw_donut_skewed
|
|
|
|
};
|
2012-11-02 21:11:12 +00:00
|
|
|
|
2014-01-10 23:10:13 +00:00
|
|
|
canvas->save();
|
|
|
|
canvas->scale(scales[s], scales[s]);
|
|
|
|
this->drawProcs(canvas, r, paint, false, procs, SK_ARRAY_COUNT(procs));
|
|
|
|
canvas->translate(r.width() * 4/3, 0);
|
|
|
|
this->drawProcs(canvas, r, paint, true, procs, SK_ARRAY_COUNT(procs));
|
|
|
|
canvas->restore();
|
2012-11-02 21:11:12 +00:00
|
|
|
|
2014-01-10 23:10:13 +00:00
|
|
|
canvas->translate(0, SK_ARRAY_COUNT(procs) * r.height() * 4/3 * scales[s]);
|
|
|
|
}
|
|
|
|
canvas->restore();
|
|
|
|
canvas->translate(2 * r.width() * 4/3 * scales[s], 0);
|
|
|
|
}
|
2012-11-02 21:11:12 +00:00
|
|
|
}
|
|
|
|
|
2014-04-30 13:20:45 +00:00
|
|
|
virtual uint32_t onGetFlags() const { return kSkipPipe_Flag | kSkipTiled_Flag; }
|
2012-11-02 21:11:12 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void drawProcs(SkCanvas* canvas, const SkRect& r, const SkPaint& paint,
|
|
|
|
bool doClip, const Proc procs[], size_t procsCount) {
|
|
|
|
SkAutoCanvasRestore acr(canvas, true);
|
|
|
|
for (size_t i = 0; i < procsCount; ++i) {
|
|
|
|
if (doClip) {
|
|
|
|
SkRect clipRect(r);
|
|
|
|
clipRect.inset(STROKE_WIDTH/2, STROKE_WIDTH/2);
|
|
|
|
canvas->save();
|
|
|
|
canvas->clipRect(r);
|
|
|
|
}
|
|
|
|
procs[i](canvas, r, paint);
|
|
|
|
if (doClip) {
|
|
|
|
canvas->restore();
|
|
|
|
}
|
|
|
|
canvas->translate(0, r.height() * 4/3);
|
|
|
|
}
|
|
|
|
}
|
2013-02-20 16:42:06 +00:00
|
|
|
private:
|
2012-11-02 21:11:12 +00:00
|
|
|
typedef GM INHERITED;
|
|
|
|
};
|
|
|
|
|
2013-01-04 20:29:03 +00:00
|
|
|
class BlurRectCompareGM : public skiagm::GM {
|
|
|
|
SkString fName;
|
|
|
|
unsigned int fRectWidth, fRectHeight;
|
2013-01-07 20:25:04 +00:00
|
|
|
SkScalar fRadius;
|
2014-04-28 16:25:35 +00:00
|
|
|
SkBlurStyle fStyle;
|
2013-01-04 20:29:03 +00:00
|
|
|
public:
|
2013-09-07 07:01:16 +00:00
|
|
|
BlurRectCompareGM(const char name[], unsigned int rectWidth,
|
|
|
|
unsigned int rectHeight, float radius,
|
2014-04-28 16:25:35 +00:00
|
|
|
SkBlurStyle style)
|
2013-01-11 20:54:44 +00:00
|
|
|
: fName(name)
|
|
|
|
, fRectWidth(rectWidth)
|
|
|
|
, fRectHeight(rectHeight)
|
|
|
|
, fRadius(radius)
|
2013-09-06 14:16:12 +00:00
|
|
|
, fStyle(style) {
|
|
|
|
}
|
2013-02-21 07:15:03 +00:00
|
|
|
int width() const {
|
|
|
|
return fRectWidth;
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
2013-02-21 07:15:03 +00:00
|
|
|
int height() const {
|
|
|
|
return fRectHeight;
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
2013-02-21 07:15:03 +00:00
|
|
|
SkScalar radius() const {
|
|
|
|
return fRadius;
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
2014-04-28 16:25:35 +00:00
|
|
|
SkBlurStyle style() const {
|
2013-02-21 07:15:03 +00:00
|
|
|
return fStyle;
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
2013-01-04 20:29:03 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual SkString onShortName() {
|
|
|
|
return fName;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual SkISize onISize() {
|
|
|
|
return SkISize::Make(640, 480);
|
|
|
|
}
|
2013-01-05 02:02:05 +00:00
|
|
|
|
2013-02-20 16:42:06 +00:00
|
|
|
virtual bool makeMask(SkMask *m, const SkRect&) = 0;
|
2013-01-04 20:29:03 +00:00
|
|
|
|
|
|
|
virtual void onDraw(SkCanvas* canvas) {
|
2013-02-20 16:42:06 +00:00
|
|
|
SkRect r;
|
|
|
|
r.setWH(SkIntToScalar(fRectWidth), SkIntToScalar(fRectHeight));
|
|
|
|
|
|
|
|
SkISize canvas_size = canvas->getDeviceSize();
|
2013-02-20 19:02:34 +00:00
|
|
|
int center_x = (canvas_size.fWidth - (int)(r.width()))/2;
|
|
|
|
int center_y = (canvas_size.fHeight - (int)(r.height()))/2;
|
2013-02-20 16:42:06 +00:00
|
|
|
|
|
|
|
SkMask mask;
|
|
|
|
|
|
|
|
if (!this->makeMask(&mask, r)) {
|
|
|
|
SkPaint paint;
|
2013-02-20 19:02:34 +00:00
|
|
|
r.offset( SkIntToScalar(center_x), SkIntToScalar(center_y) );
|
2013-02-20 16:42:06 +00:00
|
|
|
canvas->drawRect(r,paint);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
SkAutoMaskFreeImage amfi(mask.fImage);
|
2013-01-04 20:29:03 +00:00
|
|
|
|
2013-02-20 16:42:06 +00:00
|
|
|
SkBitmap bm;
|
2014-02-17 21:21:46 +00:00
|
|
|
bm.installMaskPixels(mask);
|
2013-01-04 20:29:03 +00:00
|
|
|
|
2013-02-20 16:42:06 +00:00
|
|
|
center_x = (canvas_size.fWidth - mask.fBounds.width())/2;
|
|
|
|
center_y = (canvas_size.fHeight - mask.fBounds.height())/2;
|
2013-01-04 20:29:03 +00:00
|
|
|
|
2013-02-20 19:02:34 +00:00
|
|
|
canvas->drawBitmap(bm, SkIntToScalar(center_x), SkIntToScalar(center_y), NULL);
|
2013-01-04 20:29:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual uint32_t onGetFlags() const { return kSkipPipe_Flag; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
typedef GM INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
class BlurRectFastGM: public BlurRectCompareGM {
|
|
|
|
public:
|
2013-08-27 16:14:03 +00:00
|
|
|
BlurRectFastGM(const char name[], unsigned int rectWidth,
|
|
|
|
unsigned int rectHeight, float blurRadius,
|
2014-04-28 16:25:35 +00:00
|
|
|
SkBlurStyle style) :
|
2013-08-27 16:14:03 +00:00
|
|
|
INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
2013-08-27 16:14:03 +00:00
|
|
|
|
2013-01-04 20:29:03 +00:00
|
|
|
protected:
|
2013-02-20 16:42:06 +00:00
|
|
|
virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
|
2013-09-06 14:16:12 +00:00
|
|
|
return SkBlurMask::BlurRect(SkBlurMask::ConvertRadiusToSigma(this->radius()),
|
|
|
|
m, r, this->style());
|
2013-01-07 20:25:04 +00:00
|
|
|
}
|
2013-02-20 16:42:06 +00:00
|
|
|
private:
|
|
|
|
typedef BlurRectCompareGM INHERITED;
|
2013-01-04 20:29:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class BlurRectSlowGM: public BlurRectCompareGM {
|
|
|
|
public:
|
2013-09-06 14:16:12 +00:00
|
|
|
BlurRectSlowGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
|
2014-04-28 16:25:35 +00:00
|
|
|
float blurRadius, SkBlurStyle style)
|
2013-09-06 14:16:12 +00:00
|
|
|
: INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
2013-09-06 14:16:12 +00:00
|
|
|
|
2013-01-04 20:29:03 +00:00
|
|
|
protected:
|
2013-02-20 16:42:06 +00:00
|
|
|
virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
|
2013-01-07 20:25:04 +00:00
|
|
|
SkMask src;
|
|
|
|
r.roundOut(&src.fBounds);
|
|
|
|
src.fBounds.offset(-src.fBounds.fLeft, -src.fBounds.fTop); // move to origin
|
|
|
|
src.fFormat = SkMask::kA8_Format;
|
|
|
|
src.fRowBytes = src.fBounds.width();
|
2013-02-20 16:42:06 +00:00
|
|
|
src.fImage = SkMask::AllocImage(src.computeTotalImageSize());
|
2013-01-11 20:54:44 +00:00
|
|
|
SkAutoMaskFreeImage amfi(src.fImage);
|
2013-01-04 20:29:03 +00:00
|
|
|
|
2013-01-11 20:54:44 +00:00
|
|
|
memset(src.fImage, 0xff, src.computeTotalImageSize());
|
2013-01-04 20:29:03 +00:00
|
|
|
|
2013-09-07 07:01:16 +00:00
|
|
|
return SkBlurMask::BoxBlur(m, src,
|
|
|
|
SkBlurMask::ConvertRadiusToSigma(this->radius()),
|
2013-09-06 14:16:12 +00:00
|
|
|
this->style(), this->getQuality());
|
2013-01-07 20:25:04 +00:00
|
|
|
}
|
2013-02-20 16:42:06 +00:00
|
|
|
|
2014-04-28 16:25:35 +00:00
|
|
|
virtual SkBlurQuality getQuality() {
|
|
|
|
return kHigh_SkBlurQuality;
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
|
|
|
private:
|
|
|
|
typedef BlurRectCompareGM INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
class BlurRectSlowLowGM: public BlurRectSlowGM {
|
|
|
|
public:
|
2013-02-21 07:15:03 +00:00
|
|
|
BlurRectSlowLowGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
|
2014-04-28 16:25:35 +00:00
|
|
|
float blurRadius, SkBlurStyle style)
|
2013-09-06 14:16:12 +00:00
|
|
|
: INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
2013-09-06 14:16:12 +00:00
|
|
|
|
2013-02-20 16:42:06 +00:00
|
|
|
protected:
|
2014-04-28 16:25:35 +00:00
|
|
|
virtual SkBlurQuality getQuality() SK_OVERRIDE {
|
|
|
|
return kLow_SkBlurQuality;
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
|
|
|
private:
|
|
|
|
typedef BlurRectSlowGM INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
class BlurRectGroundTruthGM: public BlurRectCompareGM {
|
|
|
|
public:
|
2013-02-21 07:15:03 +00:00
|
|
|
BlurRectGroundTruthGM(const char name[], unsigned int rectWidth, unsigned int rectHeight,
|
2014-04-28 16:25:35 +00:00
|
|
|
float blurRadius, SkBlurStyle style)
|
2013-09-06 14:16:12 +00:00
|
|
|
: INHERITED(name, rectWidth, rectHeight, blurRadius, style) {
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
2013-09-06 14:16:12 +00:00
|
|
|
|
2013-02-20 16:42:06 +00:00
|
|
|
protected:
|
|
|
|
virtual bool makeMask(SkMask *m, const SkRect& r) SK_OVERRIDE {
|
|
|
|
SkMask src;
|
|
|
|
r.roundOut(&src.fBounds);
|
|
|
|
src.fBounds.offset(-src.fBounds.fLeft, -src.fBounds.fTop); // move to origin
|
|
|
|
src.fFormat = SkMask::kA8_Format;
|
|
|
|
src.fRowBytes = src.fBounds.width();
|
|
|
|
src.fImage = SkMask::AllocImage(src.computeTotalImageSize());
|
|
|
|
SkAutoMaskFreeImage amfi(src.fImage);
|
|
|
|
|
|
|
|
memset(src.fImage, 0xff, src.computeTotalImageSize());
|
|
|
|
|
2013-09-06 14:16:12 +00:00
|
|
|
return SkBlurMask::BlurGroundTruth(SkBlurMask::ConvertRadiusToSigma(this->radius()),
|
|
|
|
m, src, this->style());
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
|
|
|
|
2014-04-28 16:25:35 +00:00
|
|
|
virtual SkBlurQuality getQuality() {
|
|
|
|
return kHigh_SkBlurQuality;
|
2013-02-20 16:42:06 +00:00
|
|
|
}
|
|
|
|
private:
|
|
|
|
typedef BlurRectCompareGM INHERITED;
|
2013-01-04 20:29:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-11-02 21:11:12 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2014-01-10 23:10:13 +00:00
|
|
|
DEF_GM(return new BlurRectGM("blurrects", 0xFF);)
|
2012-12-17 21:20:53 +00:00
|
|
|
|
2013-11-25 19:44:07 +00:00
|
|
|
static const SkScalar kBig = 20;
|
|
|
|
static const SkScalar kSmall = 2;
|
2013-09-06 14:16:12 +00:00
|
|
|
|
2013-02-20 16:42:06 +00:00
|
|
|
// regular size rects, blurs should be small enough not to completely overlap.
|
|
|
|
|
2014-04-28 16:25:35 +00:00
|
|
|
DEF_GM(return new BlurRectFastGM( "blurrect_25_100_2_normal_fast", 25, 100, kSmall, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM("blurrect_25_100_20_normal_fast", 25, 100, kBig, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM( "blurrect_25_100_2_normal_slow", 25, 100, kSmall, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM("blurrect_25_100_20_normal_slow", 25, 100, kBig, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM( "blurrect_25_100_2_inner_fast", 25, 100, kSmall, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM("blurrect_25_100_20_inner_fast", 25, 100, kBig, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM( "blurrect_25_100_2_inner_slow", 25, 100, kSmall, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM("blurrect_25_100_20_inner_slow", 25, 100, kBig, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM( "blurrect_25_100_2_outer_fast", 25, 100, kSmall, kOuter_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM("blurrect_25_100_20_outer_fast", 25, 100, kBig, kOuter_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM( "blurrect_25_100_2_outer_slow", 25, 100, kSmall, kOuter_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM("blurrect_25_100_20_outer_slow", 25, 100, kBig, kOuter_SkBlurStyle);)
|
2013-02-20 16:42:06 +00:00
|
|
|
|
|
|
|
// skinny tall rects, blurs overlap in X but not y
|
|
|
|
|
2014-04-28 16:25:35 +00:00
|
|
|
DEF_GM(return new BlurRectFastGM( "blurrect_5_100_2_normal_fast", 5, 100, kSmall, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM("blurrect_5_100_20_normal_fast", 5, 100, kBig, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM( "blurrect_5_100_2_normal_slow", 5, 100, kSmall, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM("blurrect_5_100_20_normal_slow", 5, 100, kBig, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM( "blurrect_5_100_2_inner_fast", 5, 100, kSmall, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM("blurrect_5_100_20_inner_fast", 5, 100, kBig, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM( "blurrect_5_100_2_inner_slow", 5, 100, kSmall, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM("blurrect_5_100_20_inner_slow", 5, 100, kBig, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM( "blurrect_5_100_2_outer_fast", 5, 100, kSmall, kOuter_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM("blurrect_5_100_20_outer_fast", 5, 100, kBig, kOuter_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM( "blurrect_5_100_2_outer_slow", 5, 100, kSmall, kOuter_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM("blurrect_5_100_20_outer_slow", 5, 100, kBig, kOuter_SkBlurStyle);)
|
2013-02-20 16:42:06 +00:00
|
|
|
|
|
|
|
// tiny rects, blurs overlap in X and Y
|
|
|
|
|
2014-04-28 16:25:35 +00:00
|
|
|
DEF_GM(return new BlurRectFastGM( "blurrect_5_5_2_normal_fast", 5, 5, kSmall, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM("blurrect_5_5_20_normal_fast", 5, 5, kBig, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM( "blurrect_5_5_2_normal_slow", 5, 5, kSmall, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM("blurrect_5_5_20_normal_slow", 5, 5, kBig, kNormal_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM( "blurrect_5_5_2_inner_fast", 5, 5, kSmall, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM("blurrect_5_5_20_inner_fast", 5, 5, kBig, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM( "blurrect_5_5_2_inner_slow", 5, 5, kSmall, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM("blurrect_5_5_20_inner_slow", 5, 5, kBig, kInner_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM( "blurrect_5_5_2_outer_fast", 5, 5, kSmall, kOuter_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectFastGM("blurrect_5_5_20_outer_fast", 5, 5, kBig, kOuter_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM( "blurrect_5_5_2_outer_slow", 5, 5, kSmall, kOuter_SkBlurStyle);)
|
|
|
|
DEF_GM(return new BlurRectSlowGM("blurrect_5_5_20_outer_slow", 5, 5, kBig, kOuter_SkBlurStyle);)
|
2013-02-20 16:42:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
// dont' need to GM the gaussian convolution; it's slow and intended
|
|
|
|
// as a ground truth comparison only. Leaving these here in case we
|
|
|
|
// ever want to turn these back on for debugging reasons.
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_1_simple", 25, 100, 1);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_2_simple", 25, 100, 2);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_3_simple", 25, 100, 3);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_4_simple", 25, 100, 4);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_5_simple", 25, 100, 5);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_6_simple", 25, 100, 6);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_7_simple", 25, 100, 7);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_8_simple", 25, 100, 8);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM( "blurrect_25_100_9_simple", 25, 100, 9);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_10_simple", 25, 100, 10);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_11_simple", 25, 100, 11);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_12_simple", 25, 100, 12);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_13_simple", 25, 100, 13);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_14_simple", 25, 100, 14);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_15_simple", 25, 100, 15);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_16_simple", 25, 100, 16);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_17_simple", 25, 100, 17);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_18_simple", 25, 100, 18);)
|
|
|
|
DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_19_simple", 25, 100, 19);)
|
|
|
|
#endif
|