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

Unified Diff: gm/imagefiltersgraph.cpp

Issue 1847583002: Update SkMergeImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to To 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/imagefilterscropped.cpp ('k') | gm/testimagefilters.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersgraph.cpp
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp
index 53343bc3d07942751d42565c162459308c226202..e7abdcfc0ff64e660eb080e6837fd66de7910da8 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -88,7 +88,7 @@ SkFlattenable* SimpleOffsetFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
SkScalar dx = buffer.readScalar();
SkScalar dy = buffer.readScalar();
- return Create(dx, dy, common.getInput(0));
+ return Create(dx, dy, common.getInput(0).get());
}
#ifndef SK_IGNORE_TO_STRING
@@ -118,15 +118,16 @@ protected:
void onDraw(SkCanvas* canvas) override {
canvas->clear(SK_ColorBLACK);
{
- SkAutoTUnref<SkImageFilter> bitmapSource(SkImageSource::Create(fImage.get()));
- auto cf(SkColorFilter::MakeModeFilter(SK_ColorRED, SkXfermode::kSrcIn_Mode));
- SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(4.0f, 4.0f, bitmapSource));
- SkAutoTUnref<SkImageFilter> erode(SkErodeImageFilter::Create(4, 4, blur));
- SkAutoTUnref<SkImageFilter> color(SkColorFilterImageFilter::Create(cf.get(), erode));
- SkAutoTUnref<SkImageFilter> merge(SkMergeImageFilter::Create(blur, color));
+ sk_sp<SkImageFilter> bitmapSource(SkImageSource::Create(fImage.get()));
+ sk_sp<SkColorFilter> cf(SkColorFilter::MakeModeFilter(SK_ColorRED,
+ SkXfermode::kSrcIn_Mode));
+ sk_sp<SkImageFilter> blur(SkBlurImageFilter::Create(4.0f, 4.0f, bitmapSource.get()));
+ sk_sp<SkImageFilter> erode(SkErodeImageFilter::Create(4, 4, blur.get()));
+ sk_sp<SkImageFilter> color(SkColorFilterImageFilter::Create(cf.get(), erode.get()));
+ sk_sp<SkImageFilter> merge(SkMergeImageFilter::Make(blur, color));
SkPaint paint;
- paint.setImageFilter(merge);
+ paint.setImageFilter(std::move(merge));
canvas->drawPaint(paint);
canvas->translate(SkIntToScalar(100), 0);
}
« no previous file with comments | « gm/imagefilterscropped.cpp ('k') | gm/testimagefilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698