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

Unified Diff: samplecode/SampleDither.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/SampleDegenerateTwoPtRadials.cpp ('k') | samplecode/SampleDitherBitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleDither.cpp
diff --git a/samplecode/SampleDither.cpp b/samplecode/SampleDither.cpp
index 8c14fb5110bfd409c6d5d045cc311df44bcfab91..a599418723f9b64574608eb8e23040be27e6fd3e 100644
--- a/samplecode/SampleDither.cpp
+++ b/samplecode/SampleDither.cpp
@@ -34,9 +34,8 @@ static void draw_sweep(SkCanvas* c, int width, int height, SkScalar angle) {
// SkColor colors[] = { SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN, SK_ColorCYAN };
SkColor colors[] = { 0x4c737373, 0x4c737373, 0xffffd300 };
- SkShader* s = SkGradientShader::CreateSweep(r.centerX(), r.centerY(),
- colors, nullptr, SK_ARRAY_COUNT(colors));
- p.setShader(s)->unref();
+ p.setShader(SkGradientShader::MakeSweep(r.centerX(), r.centerY(),
+ colors, nullptr, SK_ARRAY_COUNT(colors)));
SkAutoCanvasRestore acr(c, true);
« no previous file with comments | « samplecode/SampleDegenerateTwoPtRadials.cpp ('k') | samplecode/SampleDitherBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698