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

Unified Diff: gm/imagefiltersbase.cpp

Issue 1822623002: switch colorfilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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/imagefilters.cpp ('k') | gm/imagefilterscropexpand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersbase.cpp
diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp
index a55328a999fd2489e9c463f0e03a2531ff8a6380..ca8a2d421a758342248e5d489875c6868fb64f51 100644
--- a/gm/imagefiltersbase.cpp
+++ b/gm/imagefiltersbase.cpp
@@ -192,18 +192,16 @@ protected:
draw_bitmap,
};
- SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorRED,
- SkXfermode::kSrcIn_Mode);
+ auto cf = SkColorFilter::MakeModeFilter(SK_ColorRED, SkXfermode::kSrcIn_Mode);
SkImageFilter* filters[] = {
nullptr,
IdentityImageFilter::Create(),
FailImageFilter::Create(),
- SkColorFilterImageFilter::Create(cf),
+ SkColorFilterImageFilter::Create(cf.get()),
SkBlurImageFilter::Create(12.0f, 0.0f),
SkDropShadowImageFilter::Create(10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLUE,
SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode),
};
- cf->unref();
SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));
SkScalar MARGIN = SkIntToScalar(16);
@@ -320,7 +318,7 @@ public:
ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {}
void installFilter(SkPaint* paint) override {
- paint->setColorFilter(SkColorFilter::CreateModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mode))->unref();
+ paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mode));
}
};
DEF_GM( return new ImageFiltersText_CF; )
« no previous file with comments | « gm/imagefilters.cpp ('k') | gm/imagefilterscropexpand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698