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

Unified Diff: gm/lumafilter.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/imagefiltersgraph.cpp ('k') | gm/megalooper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/lumafilter.cpp
diff --git a/gm/lumafilter.cpp b/gm/lumafilter.cpp
index adffd008c10bbe571d495d007e3ce827d8c95b61..10eefabd5642ddc7c382a7bfbfe48e8138120be5 100644
--- a/gm/lumafilter.cpp
+++ b/gm/lumafilter.cpp
@@ -26,7 +26,7 @@ static void draw_label(SkCanvas* canvas, const char* label,
paint);
}
-static void draw_scene(SkCanvas* canvas, SkColorFilter* filter, SkXfermode::Mode mode,
+static void draw_scene(SkCanvas* canvas, const sk_sp<SkColorFilter>& filter, SkXfermode::Mode mode,
const sk_sp<SkShader>& s1, const sk_sp<SkShader>& s2) {
SkPaint paint;
paint.setAntiAlias(true);
@@ -83,7 +83,7 @@ public:
SkPoint g2Points[] = { { 0, 0 }, { kSize, 0 } };
SkScalar pos[] = { 0.2f, 1.0f };
- fFilter.reset(SkLumaColorFilter::Create());
+ fFilter = SkLumaColorFilter::Make();
fGr1 = SkGradientShader::MakeLinear(g1Points, g1Colors, pos, SK_ARRAY_COUNT(g1Colors),
SkShader::kClamp_TileMode);
fGr2 = SkGradientShader::MakeLinear(g2Points, g2Colors, pos, SK_ARRAY_COUNT(g2Colors),
@@ -137,8 +137,8 @@ protected:
}
private:
- SkAutoTUnref<SkColorFilter> fFilter;
- sk_sp<SkShader> fGr1, fGr2;
+ sk_sp<SkColorFilter> fFilter;
+ sk_sp<SkShader> fGr1, fGr2;
typedef skiagm::GM INHERITED;
};
« no previous file with comments | « gm/imagefiltersgraph.cpp ('k') | gm/megalooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698