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

Unified Diff: gm/tileimagefilter.cpp

Issue 1842243002: Update SkImageSource to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 9 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/resizeimagefilter.cpp ('k') | gm/xfermodeimagefilter.cpp » ('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 f75e7f97221553f2cd31b6cab14a46d0fd14d201..1f1025c0a44871f2ac971ea446df252a3db1aa16 100644
--- a/gm/tileimagefilter.cpp
+++ b/gm/tileimagefilter.cpp
@@ -56,7 +56,7 @@ protected:
int x = 0, y = 0;
for (size_t i = 0; i < 4; i++) {
- SkImage* image = (i & 0x01) ? fCheckerboard.get() : fBitmap.get();
+ sk_sp<SkImage> image = (i & 0x01) ? fCheckerboard : fBitmap;
SkRect srcRect = SkRect::MakeXYWH(SkIntToScalar(image->width()/4),
SkIntToScalar(image->height()/4),
SkIntToScalar(image->width()/(i+1)),
@@ -65,13 +65,12 @@ protected:
SkIntToScalar(i * 4),
SkIntToScalar(image->width() - i * 12),
SkIntToScalar(image->height()) - i * 12);
- SkAutoTUnref<SkImageFilter> tileInput(SkImageSource::Create(image));
- SkAutoTUnref<SkImageFilter> filter(
- SkTileImageFilter::Create(srcRect, dstRect, tileInput));
+ sk_sp<SkImageFilter> tileInput(SkImageSource::Make(image));
+ sk_sp<SkImageFilter> filter(SkTileImageFilter::Create(srcRect, dstRect, tileInput.get()));
canvas->save();
canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
SkPaint paint;
- paint.setImageFilter(filter);
+ paint.setImageFilter(std::move(filter));
canvas->drawImage(fBitmap.get(), 0, 0, &paint);
canvas->drawRect(srcRect, red);
canvas->drawRect(dstRect, blue);
« no previous file with comments | « gm/resizeimagefilter.cpp ('k') | gm/xfermodeimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698