31 paint.setAntiAlias(
true);
36 const double sigmas[] = {3.0, 8.0, 16.0, 24.0, 32.0};
38 canvas->drawString(
"mask blur", 285, 50,
font,
paint);
39 canvas->drawString(
"image blur", 285 + 250, 50,
font,
paint);
42 SkRect r = {35, 100, 135, 200};
43 for (
auto sigma:sigmas) {
45 canvas->drawRect(r,
paint);
48 sprintf(
out,
"Sigma: %g", sigma);
54 canvas->drawRect(r,
paint);
55 paint.setMaskFilter(
nullptr);
60 canvas->saveLayer(
nullptr, &imageBlurPaint);
62 canvas->drawRect(r,
paint);
72 *errorMsg =
"Could not load mandrill_128.png. Did you forget to set the resourcePath?";
83 canvas->scale(1.01f, 1.01f);
@ kNormal_SkBlurStyle
fuzzy inside and outside
constexpr SkColor SK_ColorBLACK
DEF_SIMPLE_GM(blurimagevmask, canvas, 700, 1200)
DEF_SIMPLE_GM_CAN_FAIL(blur_image, canvas, errorMsg, 500, 500)
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
sk_sp< const SkImage > image
font
Font Metadata and Metrics.
SkSamplingOptions(SkFilterMode::kLinear))
constexpr float left() const
void offset(float dx, float dy)
constexpr float bottom() const