Hide filter-quality from imagefilter::shader

Bug: skia:7650
Change-Id: Ia16f169efdb6be2ce381b9ab3b7f6fcecda26312
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/363799
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2021-02-02 08:52:56 -05:00 committed by Skia Commit-Bot
parent 129bc16b56
commit c858554f38
2 changed files with 13 additions and 18 deletions

View File

@ -331,15 +331,15 @@ public:
return Shader(std::move(shader), Dither::kNo, cropRect);
}
static sk_sp<SkImageFilter> Shader(sk_sp<SkShader> shader, Dither dither,
const CropRect& cropRect = {}) {
return Shader(std::move(shader), dither, kNone_SkFilterQuality, cropRect);
}
const CropRect& cropRect = {});
#ifdef SK_SUPPORT_LEGACY_IMPLICIT_FILTERQUALITY
// As above, but the filter quality defines what is used in image shaders that defer to the
// quality stored on an SkPaint. NOTE: this default behavior is deprecated, so prefer creating
// image shaders with explicit sampling parameters and call the other Shader() factory instead.
static sk_sp<SkImageFilter> Shader(sk_sp<SkShader> shader, Dither dither,
SkFilterQuality filterQuality,
const CropRect& cropRect = {});
#endif
/**
* Create a tile image filter.
@ -350,21 +350,6 @@ public:
static sk_sp<SkImageFilter> Tile(const SkRect& src, const SkRect& dst,
sk_sp<SkImageFilter> input);
/**
* This filter takes an SkBlendMode and uses it to composite the two filters together.
* @param mode The blend mode that defines the compositing operation
* @param background The Dst pixels used in blending, if null the source bitmap is used.
* @param foreground The Src pixels used in blending, if null the source bitmap is used.
* @cropRect Optional rectangle to crop input and output.
*
* DEPRECATED: Prefer the more idiomatic Blend function
*/
static sk_sp<SkImageFilter> Xfermode(SkBlendMode mode, sk_sp<SkImageFilter> background,
sk_sp<SkImageFilter> foreground = nullptr,
const CropRect& cropRect = {}) {
return Blend(mode, std::move(background), std::move(foreground), cropRect);
}
// Morphology filter effects
/**

View File

@ -177,6 +177,15 @@ sk_sp<SkImageFilter> SkImageFilters::Picture(sk_sp<SkPicture> pic, const SkRect&
return SkPictureImageFilter::Make(std::move(pic), targetRect);
}
sk_sp<SkImageFilter> SkImageFilters::Shader(sk_sp<SkShader> shader, Dither dither,
const CropRect& cropRect) {
SkPaint paint;
paint.setShader(std::move(shader));
paint.setDither((bool) dither);
return SkPaintImageFilter::Make(paint, cropRect);
}
#ifdef SK_SUPPORT_LEGACY_IMPLICIT_FILTERQUALITY
sk_sp<SkImageFilter> SkImageFilters::Shader(sk_sp<SkShader> shader, Dither dither,
SkFilterQuality filterQuality,
const CropRect& cropRect) {
@ -187,6 +196,7 @@ sk_sp<SkImageFilter> SkImageFilters::Shader(sk_sp<SkShader> shader, Dither dithe
paint.setFilterQuality(filterQuality);
return SkPaintImageFilter::Make(paint, cropRect);
}
#endif
sk_sp<SkImageFilter> SkImageFilters::Tile(
const SkRect& src, const SkRect& dst, sk_sp<SkImageFilter> input) {