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

Unified Diff: samplecode/SampleDitherBitmap.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/SampleDither.cpp ('k') | samplecode/SampleEffects.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleDitherBitmap.cpp
diff --git a/samplecode/SampleDitherBitmap.cpp b/samplecode/SampleDitherBitmap.cpp
index df72dd4ffea6ba21e50fdd0daf05ef853c293f12..34241c5e025f1bc78af1d78b2f5994655e5a5679 100644
--- a/samplecode/SampleDitherBitmap.cpp
+++ b/samplecode/SampleDitherBitmap.cpp
@@ -26,11 +26,8 @@ static void draw_gradient(SkCanvas* canvas) {
SkRect r = { 0, 0, SkIntToScalar(256), SkIntToScalar(32) };
SkPoint pts[] = { { r.fLeft, r.fTop }, { r.fRight, r.fTop } };
SkColor colors[] = { 0xFF000000, 0xFFFF0000 };
- SkShader* s = SkGradientShader::CreateLinear(pts, colors, nullptr, 2,
- SkShader::kClamp_TileMode);
-
SkPaint p;
- p.setShader(s)->unref();
+ p.setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode));
draw_rect(canvas, r, p);
canvas->translate(0, SkIntToScalar(40));
« no previous file with comments | « samplecode/SampleDither.cpp ('k') | samplecode/SampleEffects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698