Update gms to use new image filter factories
Bug: skia:9280
Change-Id: Ic7ca3a9c86025128bc45b89ea90aa4553287b8c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230879
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/gm/colorfilterimagefilter.cpp b/gm/colorfilterimagefilter.cpp
index cfce7a4..9373388 100644
--- a/gm/colorfilterimagefilter.cpp
+++ b/gm/colorfilterimagefilter.cpp
@@ -19,10 +19,9 @@
#include "include/core/SkScalar.h"
#include "include/core/SkShader.h"
#include "include/core/SkTileMode.h"
-#include "include/effects/SkBlurImageFilter.h"
-#include "include/effects/SkColorFilterImageFilter.h"
#include "include/effects/SkColorMatrix.h"
#include "include/effects/SkGradientShader.h"
+#include "include/effects/SkImageFilters.h"
#include "include/private/SkTArray.h"
#include "include/private/SkTDArray.h"
#include "tools/Resources.h"
@@ -100,19 +99,19 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
static sk_sp<SkImageFilter> make_blur(float amount, sk_sp<SkImageFilter> input) {
- return SkBlurImageFilter::Make(amount, amount, std::move(input));
+ return SkImageFilters::Blur(amount, amount, std::move(input));
}
static sk_sp<SkImageFilter> make_brightness(float amount, sk_sp<SkImageFilter> input) {
- return SkColorFilterImageFilter::Make(cf_make_brightness(amount), std::move(input));
+ return SkImageFilters::ColorFilter(cf_make_brightness(amount), std::move(input));
}
static sk_sp<SkImageFilter> make_grayscale(sk_sp<SkImageFilter> input) {
- return SkColorFilterImageFilter::Make(cf_make_grayscale(), std::move(input));
+ return SkImageFilters::ColorFilter(cf_make_grayscale(), std::move(input));
}
static sk_sp<SkImageFilter> make_mode_blue(sk_sp<SkImageFilter> input) {
- return SkColorFilterImageFilter::Make(cf_make_colorize(SK_ColorBLUE), std::move(input));
+ return SkImageFilters::ColorFilter(cf_make_colorize(SK_ColorBLUE), std::move(input));
}
static void draw_clipped_rect(SkCanvas* canvas,
@@ -190,7 +189,7 @@
cm.setSaturation(0.0f);
sk_sp<SkColorFilter> cf(SkColorFilters::Matrix(cm));
SkPaint p;
- p.setImageFilter(SkColorFilterImageFilter::Make(std::move(cf), nullptr));
+ p.setImageFilter(SkImageFilters::ColorFilter(std::move(cf), nullptr));
canvas->saveLayer(nullptr, &p);
canvas->clear(SK_ColorRED);
}