Update SkMatrixImageFilter to sk_sp
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1858353002
Review URL: https://codereview.chromium.org/1858353002
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index ea27d7b..b0b7349 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -225,8 +225,8 @@
cropRect ? cropRect->rect() : SkRect::MakeXYWH(0, 0, 100, 100),
input.get()));
if (!cropRect) {
- this->addFilter("matrix", SkImageFilter::CreateMatrixFilter(
- matrix, kLow_SkFilterQuality, input.get()));
+ this->addFilter("matrix",
+ SkImageFilter::MakeMatrixFilter(matrix, kLow_SkFilterQuality, input).release());
}
{
@@ -801,9 +801,9 @@
sk_sp<SkColorFilter> cf(SkColorFilter::MakeModeFilter(SK_ColorWHITE, SkXfermode::kSrc_Mode));
sk_sp<SkImageFilter> cfif(SkColorFilterImageFilter::Make(std::move(cf), nullptr));
- sk_sp<SkImageFilter> imageFilter(SkImageFilter::CreateMatrixFilter(matrix,
- kNone_SkFilterQuality,
- cfif.get()));
+ sk_sp<SkImageFilter> imageFilter(SkImageFilter::MakeMatrixFilter(matrix,
+ kNone_SkFilterQuality,
+ std::move(cfif)));
SkPaint paint;
paint.setImageFilter(std::move(imageFilter));
@@ -1397,15 +1397,15 @@
SkMatrix matrix;
matrix.setScale(SkIntToScalar(2), SkIntToScalar(2));
matrix.postTranslate(SkIntToScalar(-20), SkIntToScalar(-20));
- SkAutoTUnref<SkImageFilter> matrixFilter(
- SkImageFilter::CreateMatrixFilter(matrix, kLow_SkFilterQuality));
+ sk_sp<SkImageFilter> matrixFilter(
+ SkImageFilter::MakeMatrixFilter(matrix, kLow_SkFilterQuality, nullptr));
// Test that saveLayer() with a filter nested inside another saveLayer() applies the
// correct offset to the filter matrix.
SkRect bounds1 = SkRect::MakeXYWH(10, 10, 30, 30);
canvas.saveLayer(&bounds1, nullptr);
SkPaint filterPaint;
- filterPaint.setImageFilter(matrixFilter);
+ filterPaint.setImageFilter(std::move(matrixFilter));
SkRect bounds2 = SkRect::MakeXYWH(20, 20, 10, 10);
canvas.saveLayer(&bounds2, &filterPaint);
SkPaint greenPaint;