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

Unified Diff: gm/arithmode.cpp

Issue 1772463002: use Make instead of Create to return a shared shader (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/alphagradients.cpp ('k') | gm/badpaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/arithmode.cpp
diff --git a/gm/arithmode.cpp b/gm/arithmode.cpp
index eb2ecb8abd0fe891771d636f059ed1eb48be55d3..bddd2005f83fbfbeb199e0b17255801a761beddf 100644
--- a/gm/arithmode.cpp
+++ b/gm/arithmode.cpp
@@ -31,9 +31,8 @@ static SkBitmap make_src() {
SK_ColorTRANSPARENT, SK_ColorGREEN, SK_ColorCYAN,
SK_ColorRED, SK_ColorMAGENTA, SK_ColorWHITE,
};
- SkShader* s = SkGradientShader::CreateLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
- SkShader::kClamp_TileMode);
- paint.setShader(s)->unref();
+ paint.setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
+ SkShader::kClamp_TileMode));
canvas.drawPaint(paint);
return bm;
}
@@ -47,9 +46,8 @@ static SkBitmap make_dst() {
SK_ColorBLUE, SK_ColorYELLOW, SK_ColorBLACK, SK_ColorGREEN,
sk_tool_utils::color_to_565(SK_ColorGRAY)
};
- SkShader* s = SkGradientShader::CreateLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
- SkShader::kClamp_TileMode);
- paint.setShader(s)->unref();
+ paint.setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
+ SkShader::kClamp_TileMode));
canvas.drawPaint(paint);
return bm;
}
« no previous file with comments | « gm/alphagradients.cpp ('k') | gm/badpaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698