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

Unified Diff: gm/tileimagefilter.cpp

Issue 1882113002: Update TileImageFilter 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/filterfastbounds.cpp ('k') | include/effects/SkTileImageFilter.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 fa5bb68bd50a6268ab8b2344ed35490eb91bebea..58542b7598b40d121b26c57a46c8c676934674d6 100644
--- a/gm/tileimagefilter.cpp
+++ b/gm/tileimagefilter.cpp
@@ -66,7 +66,9 @@ protected:
SkIntToScalar(image->width() - i * 12),
SkIntToScalar(image->height()) - i * 12);
sk_sp<SkImageFilter> tileInput(SkImageSource::Make(image));
- sk_sp<SkImageFilter> filter(SkTileImageFilter::Create(srcRect, dstRect, tileInput.get()));
+ sk_sp<SkImageFilter> filter(SkTileImageFilter::Make(srcRect,
+ dstRect,
+ std::move(tileInput)));
canvas->save();
canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
SkPaint paint;
@@ -91,7 +93,7 @@ protected:
SkIntToScalar(fBitmap->height()));
SkRect dstRect = SkRect::MakeWH(SkIntToScalar(fBitmap->width() * 2),
SkIntToScalar(fBitmap->height() * 2));
- sk_sp<SkImageFilter> tile(SkTileImageFilter::Create(srcRect, dstRect, nullptr));
+ sk_sp<SkImageFilter> tile(SkTileImageFilter::Make(srcRect, dstRect, nullptr));
sk_sp<SkColorFilter> cf(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
SkPaint paint;
@@ -116,7 +118,7 @@ protected:
sk_sp<SkImageFilter> green(SkColorFilterImageFilter::Make(std::move(greenCF),
nullptr,
&cropRect));
- tile.reset(SkTileImageFilter::Create(srcRect, dstRect, green.get()));
+ tile = SkTileImageFilter::Make(srcRect, dstRect, std::move(green));
paint.setColor(SK_ColorRED);
paint.setImageFilter(std::move(tile));
canvas->drawRect(dstRect, paint);
« no previous file with comments | « gm/filterfastbounds.cpp ('k') | include/effects/SkTileImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698