partial switch over to sp usage of shaders
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1776973003
Review URL: https://codereview.chromium.org/1776973003
diff --git a/gm/blurrect.cpp b/gm/blurrect.cpp
index 55c592b..0fe866f 100644
--- a/gm/blurrect.cpp
+++ b/gm/blurrect.cpp
@@ -58,7 +58,7 @@
/*
* Spits out a dummy gradient to test blur with shader on paint
*/
-static SkShader* MakeRadial() {
+static sk_sp<SkShader> MakeRadial() {
SkPoint pts[2] = {
{ 0, 0 },
{ SkIntToScalar(100), SkIntToScalar(100) }
@@ -74,10 +74,10 @@
SkScalarAve(pts[0].fY, pts[1].fY));
center1.set(SkScalarInterp(pts[0].fX, pts[1].fX, SkIntToScalar(3)/5),
SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4));
- return SkGradientShader::CreateTwoPointConical(center1, (pts[1].fX - pts[0].fX) / 7,
- center0, (pts[1].fX - pts[0].fX) / 2,
- colors, pos, SK_ARRAY_COUNT(colors), tm,
- 0, &scale);
+ return SkGradientShader::MakeTwoPointConical(center1, (pts[1].fX - pts[0].fX) / 7,
+ center0, (pts[1].fX - pts[0].fX) / 2,
+ colors, pos, SK_ARRAY_COUNT(colors), tm,
+ 0, &scale);
}
typedef void (*PaintProc)(SkPaint*, SkScalar width);
@@ -123,7 +123,7 @@
paint.setAlpha(fAlpha);
SkPaint paintWithRadial = paint;
- paintWithRadial.setShader(MakeRadial())->unref();
+ paintWithRadial.setShader(MakeRadial());
static const Proc procs[] = {
fill_rect, draw_donut, draw_donut_skewed