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

Unified Diff: gm/alphagradients.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 | « experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp ('k') | gm/arithmode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/alphagradients.cpp
diff --git a/gm/alphagradients.cpp b/gm/alphagradients.cpp
index 71ec27c975096031d461a50f9de4d3aba8985658..65fa0c4082daf3df93b7e726731846558ea0bf03 100644
--- a/gm/alphagradients.cpp
+++ b/gm/alphagradients.cpp
@@ -28,9 +28,8 @@ protected:
SkPoint pts[] = { { r.fLeft, r.fTop }, { r.fRight, r.fBottom } };
SkPaint paint;
uint32_t flags = doPreMul ? SkGradientShader::kInterpolateColorsInPremul_Flag : 0;
- SkShader* s = SkGradientShader::CreateLinear(pts, colors, nullptr, 2,
- SkShader::kClamp_TileMode, flags, nullptr);
- paint.setShader(s)->unref();
+ paint.setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, 2,
+ SkShader::kClamp_TileMode, flags, nullptr));
canvas->drawRect(r, paint);
paint.setShader(nullptr);
« no previous file with comments | « experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp ('k') | gm/arithmode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698