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

Unified Diff: samplecode/SampleBitmapRect.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/SampleBigGradient.cpp ('k') | samplecode/SampleCamera.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleBitmapRect.cpp
diff --git a/samplecode/SampleBitmapRect.cpp b/samplecode/SampleBitmapRect.cpp
index d7eed02ef909094f81c0c84c0ca521b2e857e0dd..490c6a45c312e9a8c8962fc5f5b3e54ef362958c 100644
--- a/samplecode/SampleBitmapRect.cpp
+++ b/samplecode/SampleBitmapRect.cpp
@@ -37,8 +37,8 @@ static void make_bitmap(SkBitmap* bitmap) {
paint.setAntiAlias(true);
const SkPoint pts[] = { { 0, 0 }, { SCALAR_SIZE, SCALAR_SIZE } };
const SkColor colors[] = { SK_ColorWHITE, SK_ColorBLUE };
- paint.setShader(SkGradientShader::CreateLinear(pts, colors, nullptr, 2,
- SkShader::kClamp_TileMode))->unref();
+ paint.setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, 2,
+ SkShader::kClamp_TileMode));
canvas.drawCircle(SCALAR_SIZE/2, SCALAR_SIZE/2, SCALAR_SIZE/2, paint);
}
« no previous file with comments | « samplecode/SampleBigGradient.cpp ('k') | samplecode/SampleCamera.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698