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

Unified Diff: samplecode/SampleDegenerateTwoPtRadials.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 | « samplecode/SampleColorFilter.cpp ('k') | samplecode/SampleDither.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleDegenerateTwoPtRadials.cpp
diff --git a/samplecode/SampleDegenerateTwoPtRadials.cpp b/samplecode/SampleDegenerateTwoPtRadials.cpp
index 32b45374e6c7642abffe6676ec94f21a1a4ef73f..f1712022491e4e23ee2e0ce43d62b5de0b0ac26b 100644
--- a/samplecode/SampleDegenerateTwoPtRadials.cpp
+++ b/samplecode/SampleDegenerateTwoPtRadials.cpp
@@ -27,12 +27,10 @@ static void draw_gradient2(SkCanvas* canvas, const SkRect& rect, SkScalar delta)
SkPoint c1 = { l + 3 * w / 5, t + h / 2 };
SkScalar r0 = w / 5;
SkScalar r1 = 2 * w / 5;
- SkShader* s = SkGradientShader::CreateTwoPointConical(c0, r0, c1, r1, colors,
- pos, SK_ARRAY_COUNT(pos),
- SkShader::kClamp_TileMode);
SkPaint paint;
- paint.setShader(s)->unref();
-
+ paint.setShader(SkGradientShader::MakeTwoPointConical(c0, r0, c1, r1, colors,
+ pos, SK_ARRAY_COUNT(pos),
+ SkShader::kClamp_TileMode));
canvas->drawRect(rect, paint);
}
« no previous file with comments | « samplecode/SampleColorFilter.cpp ('k') | samplecode/SampleDither.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698