17#define FILTER_WIDTH_SMALL 32
18#define FILTER_HEIGHT_SMALL 32
19#define FILTER_WIDTH_LARGE 256
20#define FILTER_HEIGHT_LARGE 256
21#define BLUR_SIGMA_MINI 0.5f
22#define BLUR_SIGMA_SMALL 1.0f
23#define BLUR_SIGMA_LARGE 10.0f
24#define BLUR_SIGMA_HUGE 80.0f
41 canvas.
clear(0x00000000);
47 for (
int x = 0;
x <
width;
x += 16) {
67 , fIsExpanded(expanded)
71 fName.
printf(
"blur_image_filter_%s%s%s_%.2f_%.2f",
72 fIsSmall ?
"small" :
"large",
73 fIsCropped ?
"_cropped" :
"",
74 fIsExpanded ?
"_expanded" :
"",
76 SkASSERT(!fIsExpanded || fIsCropped);
93 static const int kX = 0;
94 static const int kY = 0;
104 fIsExpanded ? &bmpRect : fIsCropped ? &bmpRectInset :
nullptr;
109 for (
int i = 0;
i < loops;
i++) {
#define FILTER_WIDTH_SMALL
static sk_sp< SkImage > make_checkerboard(int width, int height)
#define FILTER_WIDTH_LARGE
#define FILTER_HEIGHT_SMALL
#define FILTER_HEIGHT_LARGE
void onDelayedSetup() override
void onDraw(int loops, SkCanvas *canvas) override
BlurImageFilterBench(SkScalar sigmaX, SkScalar sigmaY, bool small, bool cropped, bool expanded)
const char * onGetName() override
sk_sp< SkImage > asImage() const
void allocN32Pixels(int width, int height, bool isOpaque=false)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void clear(SkColor color)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Offset(SkScalar dx, SkScalar dy, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
void setColor(SkColor color)
void printf(const char format[],...) SK_PRINTF_LIKE(2
const char * c_str() const
SkSamplingOptions sampling
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
SkIRect makeInset(int32_t dx, int32_t dy) const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)