Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: gm/tileimagefilter.cpp

Issue 1858813002: Update SkColorFilterImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/testimagefilters.cpp ('k') | include/effects/SkColorFilterImageFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/tileimagefilter.cpp
diff --git a/gm/tileimagefilter.cpp b/gm/tileimagefilter.cpp
index c0cca3c8950958d7ad7e3aa980cdee2e886524ed..fa5bb68bd50a6268ab8b2344ed35490eb91bebea 100644
--- a/gm/tileimagefilter.cpp
+++ b/gm/tileimagefilter.cpp
@@ -91,12 +91,11 @@ protected:
SkIntToScalar(fBitmap->height()));
SkRect dstRect = SkRect::MakeWH(SkIntToScalar(fBitmap->width() * 2),
SkIntToScalar(fBitmap->height() * 2));
- SkAutoTUnref<SkImageFilter> tile(SkTileImageFilter::Create(srcRect, dstRect, nullptr));
- auto cf(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
+ sk_sp<SkImageFilter> tile(SkTileImageFilter::Create(srcRect, dstRect, nullptr));
+ sk_sp<SkColorFilter> cf(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
- SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get(), tile.get()));
SkPaint paint;
- paint.setImageFilter(cfif);
+ paint.setImageFilter(SkColorFilterImageFilter::Make(std::move(cf), std::move(tile)));
canvas->save();
canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
canvas->clipRect(dstRect);
@@ -114,11 +113,12 @@ protected:
SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(5, 5, 40, 40));
sk_sp<SkColorFilter> greenCF = SkColorFilter::MakeModeFilter(SK_ColorGREEN,
SkXfermode::kSrc_Mode);
- SkAutoTUnref<SkImageFilter> green(SkColorFilterImageFilter::Create(greenCF.get(), nullptr,
- &cropRect));
- tile.reset(SkTileImageFilter::Create(srcRect, dstRect, green));
+ sk_sp<SkImageFilter> green(SkColorFilterImageFilter::Make(std::move(greenCF),
+ nullptr,
+ &cropRect));
+ tile.reset(SkTileImageFilter::Create(srcRect, dstRect, green.get()));
paint.setColor(SK_ColorRED);
- paint.setImageFilter(tile);
+ paint.setImageFilter(std::move(tile));
canvas->drawRect(dstRect, paint);
}
private:
« no previous file with comments | « gm/testimagefilters.cpp ('k') | include/effects/SkColorFilterImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698