25#include <initializer_list>
33 paint.setAntiAlias(
true);
40 bool xDirection = (direction & 0x1) == 1;
41 bool yDirection = (direction & 0x2) == 2;
46 paint.setAlphaf(0.5f);
56 paint.setAlphaf(0.5f);
61 return surface->makeImageSnapshot();
67 paint.setImageFilter(std::move(filter));
98 for (
auto sigma: { 0.6f, 3.0f, 8.0f, 20.0f }) {
122 using INHERITED =
GM;
127DEF_GM(
return new ImageBlurRepeatModeGM;)
157 paint.setImageFilter(std::move(filter));
162 canvas->translate(0, 50);
164 canvas->clipIRect(img->bounds().makeOutset(0, 30));
171 canvas->translate(110, 0);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorLTGRAY
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
sk_sp< SkImage > asImage() const
void eraseArea(const SkIRect &area, SkColor c) 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 clipIRect(const SkIRect &irect, SkClipOp op=SkClipOp::kIntersect)
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 > Crop(const SkRect &rect, SkTileMode tileMode, sk_sp< SkImageFilter > input)
@ kStroke_Style
set to stroke geometry
GM(SkColor backgroundColor=SK_ColorWHITE)
SkISize getISize() override
bool runAsBench() const override
void onDraw(SkCanvas *canvas) override
SkString getName() const override
static void draw_image(SkCanvas *canvas, const sk_sp< SkImage > image, sk_sp< SkImageFilter > filter)
static sk_sp< SkImage > make_image(SkCanvas *canvas, int direction)
DEF_SIMPLE_GM(imageblurrepeatunclipped, canvas, 256, 128)
Optional< SkRect > bounds
sk_sp< const SkImage > image
PODArray< SkColor > colors
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
SkSamplingOptions(SkFilterMode::kLinear))
static sk_sp< SkImage > make_image(SkColorType colorType, SkAlphaType alphaType)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static SkRect Make(const SkISize &size)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
static void checkerboard(SkCanvas *canvas, SkColor c1, SkColor c2, int size)