diff --git a/include/effects/SkImageFilters.h b/include/effects/SkImageFilters.h index 061959e77c..f85ef0eb84 100644 --- a/include/effects/SkImageFilters.h +++ b/include/effects/SkImageFilters.h @@ -331,15 +331,15 @@ public: return Shader(std::move(shader), Dither::kNo, cropRect); } static sk_sp Shader(sk_sp 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 Shader(sk_sp shader, Dither dither, SkFilterQuality filterQuality, const CropRect& cropRect = {}); +#endif /** * Create a tile image filter. @@ -350,21 +350,6 @@ public: static sk_sp Tile(const SkRect& src, const SkRect& dst, sk_sp 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 Xfermode(SkBlendMode mode, sk_sp background, - sk_sp foreground = nullptr, - const CropRect& cropRect = {}) { - return Blend(mode, std::move(background), std::move(foreground), cropRect); - } - // Morphology filter effects /** diff --git a/src/effects/imagefilters/SkImageFilters.cpp b/src/effects/imagefilters/SkImageFilters.cpp index 7e1693e742..027457331d 100644 --- a/src/effects/imagefilters/SkImageFilters.cpp +++ b/src/effects/imagefilters/SkImageFilters.cpp @@ -177,6 +177,15 @@ sk_sp SkImageFilters::Picture(sk_sp pic, const SkRect& return SkPictureImageFilter::Make(std::move(pic), targetRect); } +sk_sp SkImageFilters::Shader(sk_sp 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 SkImageFilters::Shader(sk_sp shader, Dither dither, SkFilterQuality filterQuality, const CropRect& cropRect) { @@ -187,6 +196,7 @@ sk_sp SkImageFilters::Shader(sk_sp shader, Dither dithe paint.setFilterQuality(filterQuality); return SkPaintImageFilter::Make(paint, cropRect); } +#endif sk_sp SkImageFilters::Tile( const SkRect& src, const SkRect& dst, sk_sp input) {