aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleTiling.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-08 18:50:00 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-08 18:50:00 -0800
commit8a21c9fe7f5fef9e87115defef27bd7218419f28 (patch)
tree1dd8b9eda9eae99b33bc88b97bd5f0a7a0769dc3 /samplecode/SampleTiling.cpp
parent042f859c19f71ca9feacddd1cb058ff59eed8963 (diff)
use Make instead of Create to return a shared shader
Partially updated call sites. Undefine the flag in SkSHader.h to convert the remaining sites. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1772463002 Review URL: https://codereview.chromium.org/1772463002
Diffstat (limited to 'samplecode/SampleTiling.cpp')
-rw-r--r--samplecode/SampleTiling.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp
index ed244eb3d2..125155e8d0 100644
--- a/samplecode/SampleTiling.cpp
+++ b/samplecode/SampleTiling.cpp
@@ -35,15 +35,14 @@ static void makebm(SkBitmap* bm, SkColorType ct, int w, int h) {
SkPaint paint;
paint.setDither(true);
- paint.setShader(SkGradientShader::CreateLinear(pts, colors, pos,
- SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode))->unref();
+ paint.setShader(SkGradientShader::MakeLinear(pts, colors, pos,
+ SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode));
canvas.drawPaint(paint);
}
static void setup(SkPaint* paint, const SkBitmap& bm, bool filter,
SkShader::TileMode tmx, SkShader::TileMode tmy) {
- SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy);
- paint->setShader(shader)->unref();
+ paint->setShader(SkShader::MakeBitmapShader(bm, tmx, tmy));
paint->setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality);
}