Index: gm/tablecolorfilter.cpp |
diff --git a/gm/tablecolorfilter.cpp b/gm/tablecolorfilter.cpp |
index dcc29f37cf3d8de45cb099f15a8f3aff0259c55a..1053bb25181bc71bbd3af3eb1ecd40f906d0db6e 100644 |
--- a/gm/tablecolorfilter.cpp |
+++ b/gm/tablecolorfilter.cpp |
@@ -11,14 +11,14 @@ |
#include "SkGradientShader.h" |
#include "SkTableColorFilter.h" |
-static sk_sp<SkShader> make_shader0(int w, int h) { |
+static SkShader* make_shader0(int w, int h) { |
SkPoint pts[] = { {0, 0}, {SkIntToScalar(w), SkIntToScalar(h)} }; |
SkColor colors[] = { |
SK_ColorBLACK, SK_ColorGREEN, SK_ColorCYAN, |
SK_ColorRED, 0, SK_ColorBLUE, SK_ColorWHITE |
}; |
- return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors), |
- SkShader::kClamp_TileMode); |
+ return SkGradientShader::CreateLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors), |
+ SkShader::kClamp_TileMode); |
} |
static void make_bm0(SkBitmap* bm) { |
int W = 120; |
@@ -28,17 +28,17 @@ |
SkCanvas canvas(*bm); |
SkPaint paint; |
- paint.setShader(make_shader0(W, H)); |
+ paint.setShader(make_shader0(W, H))->unref(); |
canvas.drawPaint(paint); |
} |
-static sk_sp<SkShader> make_shader1(int w, int h) { |
+static SkShader* make_shader1(int w, int h) { |
SkScalar cx = SkIntToScalar(w)/2; |
SkScalar cy = SkIntToScalar(h)/2; |
SkColor colors[] = { |
SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, |
}; |
- return SkGradientShader::MakeRadial(SkPoint::Make(cx, cy), cx, colors, nullptr, |
- SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode); |
+ return SkGradientShader::CreateRadial(SkPoint::Make(cx, cy), cx, colors, nullptr, |
+ SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode); |
} |
static void make_bm1(SkBitmap* bm) { |
int W = 120; |
@@ -50,7 +50,7 @@ |
SkCanvas canvas(*bm); |
SkPaint paint; |
- paint.setShader(make_shader1(W, H)); |
+ paint.setShader(make_shader1(W, H))->unref(); |
paint.setAntiAlias(true); |
canvas.drawCircle(cx, cy, cx, paint); |
} |
@@ -234,7 +234,7 @@ |
} |
SkPaint paint; |
- paint.setShader(make_shader1(50, 50)); |
+ paint.setShader(make_shader1(50, 50))->unref(); |
SkRect r = SkRect::MakeWH(50, 50); |
const SkScalar spacer = 10; |