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

Unified Diff: gm/lumafilter.cpp

Issue 1790353002: Revert of more shader-->sp conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/lcdblendmodes.cpp ('k') | gm/matrixconvolution.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..3244b2b055628f7fe3497d17a6fae87ab37d6e0a 100644
--- a/gm/lumafilter.cpp
+++ b/gm/lumafilter.cpp
@@ -26,8 +26,9 @@
paint);
}
-static void draw_scene(SkCanvas* canvas, SkColorFilter* filter, SkXfermode::Mode mode,
- const sk_sp<SkShader>& s1, const sk_sp<SkShader>& s2) {
+static void draw_scene(SkCanvas* canvas, SkColorFilter* filter,
+ SkXfermode::Mode mode, SkShader* s1,
+ SkShader* s2) {
SkPaint paint;
paint.setAntiAlias(true);
SkRect r, c, bounds = SkRect::MakeWH(kSize, kSize);
@@ -84,10 +85,16 @@
SkScalar pos[] = { 0.2f, 1.0f };
fFilter.reset(SkLumaColorFilter::Create());
- fGr1 = SkGradientShader::MakeLinear(g1Points, g1Colors, pos, SK_ARRAY_COUNT(g1Colors),
- SkShader::kClamp_TileMode);
- fGr2 = SkGradientShader::MakeLinear(g2Points, g2Colors, pos, SK_ARRAY_COUNT(g2Colors),
- SkShader::kClamp_TileMode);
+ fGr1.reset(SkGradientShader::CreateLinear(g1Points,
+ g1Colors,
+ pos,
+ SK_ARRAY_COUNT(g1Colors),
+ SkShader::kClamp_TileMode));
+ fGr2.reset(SkGradientShader::CreateLinear(g2Points,
+ g2Colors,
+ pos,
+ SK_ARRAY_COUNT(g2Colors),
+ SkShader::kClamp_TileMode));
}
protected:
@@ -109,8 +116,8 @@
SkXfermode::kDstIn_Mode,
};
struct {
- const sk_sp<SkShader>& fShader1;
- const sk_sp<SkShader>& fShader2;
+ SkShader* fShader1;
+ SkShader* fShader2;
} shaders[] = {
{ nullptr, nullptr },
{ nullptr, fGr2 },
@@ -138,7 +145,7 @@
private:
SkAutoTUnref<SkColorFilter> fFilter;
- sk_sp<SkShader> fGr1, fGr2;
+ SkAutoTUnref<SkShader> fGr1, fGr2;
typedef skiagm::GM INHERITED;
};
« no previous file with comments | « gm/lcdblendmodes.cpp ('k') | gm/matrixconvolution.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698