Reland of [2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (patchset #1 id:1 of https://codereview.chromium.org/1821103004/ )

Reason for revert:
guard has now landed in chrome

Original issue's description:
> Revert of Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (patchset #3 id:40001 of https://codereview.chromium.org/1825073002/ )
>
> Reason for revert:
> CreateModeFilter not compiling
>
> Original issue's description:
> > Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.org/1822623002/ )"
> >
> > Fixed legacy withColorFilter to call new(er) make method
> >
> > This reverts commit 1eb81db650d31f50be67b12d60c4f9e7dd08432f.
> >
> > BUG=skia:
> > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1825073002
> >
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/4c9776b046dd5e9e46e2d1ce35154855c8fcb381
>
> TBR=
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d6889293dd0942f27f9593f679722c956831f2c4

TBR=
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=skia:

Review URL: https://codereview.chromium.org/1827433002
diff --git a/gm/blurredclippedcircle.cpp b/gm/blurredclippedcircle.cpp
index d1d374c..3bbff75 100644
--- a/gm/blurredclippedcircle.cpp
+++ b/gm/blurredclippedcircle.cpp
@@ -67,9 +67,9 @@
                                             kNormal_SkBlurStyle,
                                             1.366025f,
                                             SkBlurMaskFilter::kHighQuality_BlurFlag))->unref();
-                    paint.setColorFilter(SkColorFilter::CreateModeFilter(
+                    paint.setColorFilter(SkColorFilter::MakeModeFilter(
                                              SK_ColorRED,
-                                             SkXfermode::kSrcIn_Mode))->unref();
+                                             SkXfermode::kSrcIn_Mode));
                     paint.setAntiAlias(true);
 
                     canvas->drawRRect(rr, paint);
diff --git a/gm/blurroundrect.cpp b/gm/blurroundrect.cpp
index fe4a939..9135ba0 100644
--- a/gm/blurroundrect.cpp
+++ b/gm/blurroundrect.cpp
@@ -60,10 +60,9 @@
                     SkBlurMask::ConvertRadiusToSigma(SK_ScalarHalf),
                     SkBlurMaskFilter::kHighQuality_BlurFlag);
             paint->setMaskFilter(maskFilter)->unref();
-            SkColorFilter* colorFilter = SkColorFilter::CreateModeFilter(
+            paint->setColorFilter(SkColorFilter::MakeModeFilter(
                     sk_tool_utils::color_to_565(SK_ColorLTGRAY),
-                    SkXfermode::kSrcIn_Mode);
-            paint->setColorFilter(colorFilter)->unref();
+                    SkXfermode::kSrcIn_Mode));
             paint->setColor(sk_tool_utils::color_to_565(SK_ColorGRAY));
         }
         {
diff --git a/gm/color4f.cpp b/gm/color4f.cpp
index 2d5b7d2..ec9bbcb 100644
--- a/gm/color4f.cpp
+++ b/gm/color4f.cpp
@@ -22,43 +22,43 @@
     return SkShader::MakeColorShader(0x80FF0000);
 }
 
-static SkColorFilter* make_cf_null() {
+static sk_sp<SkColorFilter> make_cf_null() {
     return nullptr;
 }
 
-static SkColorFilter* make_cf0() {
+static sk_sp<SkColorFilter> make_cf0() {
     SkColorMatrix cm;
     cm.setSaturation(0.75f);
-    return SkColorMatrixFilter::Create(cm);
+    return SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat);
 }
 
-static SkColorFilter* make_cf1() {
+static sk_sp<SkColorFilter> make_cf1() {
     SkColorMatrix cm;
     cm.setSaturation(0.75f);
-    SkAutoTUnref<SkColorFilter> a(SkColorMatrixFilter::Create(cm));
+    auto a(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat));
     // CreateComposedFilter will try to concat these two matrices, resulting in a single
     // filter (which is good for speed). For this test, we want to force a real compose of
     // these two, so our inner filter has a scale-up, which disables the optimization of
     // combining the two matrices.
     cm.setScale(1.1f, 0.9f, 1);
-    SkAutoTUnref<SkColorFilter> b(SkColorMatrixFilter::Create(cm));
-    return SkColorFilter::CreateComposeFilter(a, b);
+    auto b(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat));
+    return SkColorFilter::MakeComposeFilter(a, b);
 }
 
-static SkColorFilter* make_cf2() {
-    return SkColorFilter::CreateModeFilter(0x8044CC88, SkXfermode::kSrcATop_Mode);
+static sk_sp<SkColorFilter> make_cf2() {
+    return SkColorFilter::MakeModeFilter(0x8044CC88, SkXfermode::kSrcATop_Mode);
 }
 
 static void draw_into_canvas(SkCanvas* canvas) {
     const SkRect r = SkRect::MakeWH(50, 100);
     sk_sp<SkShader> (*shaders[])() { make_opaque_color, make_alpha_color };
-    SkColorFilter* (*filters[])() { make_cf_null, make_cf0, make_cf1, make_cf2 };
+    sk_sp<SkColorFilter> (*filters[])() { make_cf_null, make_cf0, make_cf1, make_cf2 };
     
     SkPaint paint;
     for (auto shProc : shaders) {
         paint.setShader(shProc());
         for (auto cfProc : filters) {
-            SkSafeUnref(paint.setColorFilter(cfProc()));
+            paint.setColorFilter(cfProc());
             canvas->drawRect(r, paint);
             canvas->translate(60, 0);
         }
diff --git a/gm/colorcube.cpp b/gm/colorcube.cpp
index 01aaf15..54e0688 100644
--- a/gm/colorcube.cpp
+++ b/gm/colorcube.cpp
@@ -25,27 +25,12 @@
 
 class ColorCubeGM : public GM {
 public:
-    ColorCubeGM()
-    : fInitialized(false)
-    , f3DLut4(nullptr)
-    , f3DLut8(nullptr)
-    , f3DLut16(nullptr)
-    , f3DLut32(nullptr)
-    , f3DLut64(nullptr)
-    {
+    ColorCubeGM() : fInitialized(false) {
         this->setBGColor(0xFF000000);
     }
 
-    ~ColorCubeGM() {
-        SkSafeUnref(f3DLut4);
-        SkSafeUnref(f3DLut8);
-        SkSafeUnref(f3DLut16);
-        SkSafeUnref(f3DLut32);
-        SkSafeUnref(f3DLut64);
-    }
-
 protected:
-    virtual SkString onShortName() {
+    SkString onShortName() override {
         return SkString("colorcube");
     }
 
@@ -67,8 +52,8 @@
         canvas.drawRect(SkRect::MakeWH(80, 80), paint);
     }
 
-    void make_3Dlut(SkData** data, int size, bool invR, bool invG, bool invB) {
-        *data = SkData::NewUninitialized(sizeof(SkColor) * size * size * size);
+    void make_3Dlut(sk_sp<SkData>* data, int size, bool invR, bool invG, bool invB) {
+        *data = SkData::MakeUninitialized(sizeof(SkColor) * size * size * size);
         SkColor* pixels = (SkColor*)((*data)->writable_data());
         SkAutoTMalloc<uint8_t> lutMemory(size);
         SkAutoTMalloc<uint8_t> invLutMemory(size);
@@ -92,11 +77,11 @@
         }
     }
 
-    virtual SkISize onISize() {
+    SkISize onISize() override {
         return SkISize::Make(500, 100);
     }
 
-    virtual void onDraw(SkCanvas* canvas) {
+    void onDraw(SkCanvas* canvas) override {
         if (!fInitialized) {
             this->make_bitmap();
             this->make_3Dluts();
@@ -104,19 +89,19 @@
         }
         canvas->clear(0x00000000);
         SkPaint paint;
-        paint.setColorFilter(SkColorCubeFilter::Create(f3DLut4, 4))->unref();
+        paint.setColorFilter(SkColorCubeFilter::Make(f3DLut4, 4));
         canvas->drawBitmap(fBitmap, 10, 10, &paint);
 
-        paint.setColorFilter(SkColorCubeFilter::Create(f3DLut8, 8))->unref();
+        paint.setColorFilter(SkColorCubeFilter::Make(f3DLut8, 8));
         canvas->drawBitmap(fBitmap, 110, 10, &paint);
 
-        paint.setColorFilter(SkColorCubeFilter::Create(f3DLut16, 16))->unref();
+        paint.setColorFilter(SkColorCubeFilter::Make(f3DLut16, 16));
         canvas->drawBitmap(fBitmap, 210, 10, &paint);
 
-        paint.setColorFilter(SkColorCubeFilter::Create(f3DLut32, 32))->unref();
+        paint.setColorFilter(SkColorCubeFilter::Make(f3DLut32, 32));
         canvas->drawBitmap(fBitmap, 310, 10, &paint);
 
-        paint.setColorFilter(SkColorCubeFilter::Create(f3DLut64, 64))->unref();
+        paint.setColorFilter(SkColorCubeFilter::Make(f3DLut64, 64));
         canvas->drawBitmap(fBitmap, 410, 10, &paint);
     }
 
@@ -124,11 +109,11 @@
     typedef GM INHERITED;
     bool fInitialized;
     SkBitmap fBitmap;
-    SkData* f3DLut4;
-    SkData* f3DLut8;
-    SkData* f3DLut16;
-    SkData* f3DLut32;
-    SkData* f3DLut64;
+    sk_sp<SkData> f3DLut4;
+    sk_sp<SkData> f3DLut8;
+    sk_sp<SkData> f3DLut16;
+    sk_sp<SkData> f3DLut32;
+    sk_sp<SkData> f3DLut64;
 };
 
 //////////////////////////////////////////////////////////////////////////////
diff --git a/gm/coloremoji.cpp b/gm/coloremoji.cpp
index 78c347c..4be8202 100644
--- a/gm/coloremoji.cpp
+++ b/gm/coloremoji.cpp
@@ -34,8 +34,8 @@
     matrix[1] = matrix[6] = matrix[11] = 0.7152f;
     matrix[2] = matrix[7] = matrix[12] = 0.0722f;
     matrix[18] = 1.0f;
-    SkAutoTUnref<SkColorFilter> filter(SkColorMatrixFilter::Create(matrix));
-    return SkColorFilterImageFilter::Create(filter, input);
+    auto filter(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
+    return SkColorFilterImageFilter::Create(filter.get(), input);
 }
 
 static SkImageFilter* make_blur(float amount, SkImageFilter* input = nullptr) {
diff --git a/gm/colorfilterimagefilter.cpp b/gm/colorfilterimagefilter.cpp
index f72108f..497757e 100644
--- a/gm/colorfilterimagefilter.cpp
+++ b/gm/colorfilterimagefilter.cpp
@@ -18,34 +18,34 @@
 #define FILTER_HEIGHT   SkIntToScalar(30)
 #define MARGIN          SkIntToScalar(10)
 
-static SkColorFilter* cf_make_brightness(float brightness) {
+static sk_sp<SkColorFilter> cf_make_brightness(float brightness) {
     SkScalar amount255 = SkScalarMul(brightness, SkIntToScalar(255));
     SkScalar matrix[20] = {
         1, 0, 0, 0, amount255,
         0, 1, 0, 0, amount255,
         0, 0, 1, 0, amount255,
         0, 0, 0, 1, 0 };
-    return SkColorMatrixFilter::Create(matrix);
+    return SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
 }
 
-static SkColorFilter* cf_make_grayscale() {
+static sk_sp<SkColorFilter> cf_make_grayscale() {
     SkScalar matrix[20];
     memset(matrix, 0, 20 * sizeof(SkScalar));
     matrix[0] = matrix[5] = matrix[10] = 0.2126f;
     matrix[1] = matrix[6] = matrix[11] = 0.7152f;
     matrix[2] = matrix[7] = matrix[12] = 0.0722f;
     matrix[18] = 1.0f;
-    return SkColorMatrixFilter::Create(matrix);
+    return SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
 }
 
-static SkColorFilter* cf_make_colorize(SkColor color) {
-    return SkColorFilter::CreateModeFilter(color, SkXfermode::kSrc_Mode);
+static sk_sp<SkColorFilter> cf_make_colorize(SkColor color) {
+    return SkColorFilter::MakeModeFilter(color, SkXfermode::kSrc_Mode);
 }
 
-static void sk_gm_get_colorfilters(SkTDArray<SkColorFilter*>* array) {
-    *array->append() = cf_make_brightness(0.5f);
-    *array->append() = cf_make_grayscale();
-    *array->append() = cf_make_colorize(SK_ColorBLUE);
+static void sk_gm_get_colorfilters(SkTArray<sk_sp<SkColorFilter>>* array) {
+    array->push_back(cf_make_brightness(0.5f));
+    array->push_back(cf_make_grayscale());
+    array->push_back(cf_make_colorize(SK_ColorBLUE));
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -92,18 +92,15 @@
 }
 
 static SkImageFilter* make_brightness(float amount, SkImageFilter* input = nullptr) {
-    SkAutoTUnref<SkColorFilter> filter(cf_make_brightness(amount));
-    return SkColorFilterImageFilter::Create(filter, input);
+    return SkColorFilterImageFilter::Create(cf_make_brightness(amount).get(), input);
 }
 
 static SkImageFilter* make_grayscale(SkImageFilter* input = nullptr) {
-    SkAutoTUnref<SkColorFilter> filter(cf_make_grayscale());
-    return SkColorFilterImageFilter::Create(filter, input);
+    return SkColorFilterImageFilter::Create(cf_make_grayscale().get(), input);
 }
 
 static SkImageFilter* make_mode_blue(SkImageFilter* input = nullptr) {
-    SkAutoTUnref<SkColorFilter> filter(cf_make_colorize(SK_ColorBLUE));
-    return SkColorFilterImageFilter::Create(filter, input);
+    return SkColorFilterImageFilter::Create(cf_make_colorize(SK_ColorBLUE).get(), input);
 }
 
 static void drawClippedRect(SkCanvas* canvas,
@@ -179,8 +176,8 @@
     SkAutoCanvasRestore autoCanvasRestore(canvas, false);
     SkColorMatrix cm;
     cm.setSaturation(0.0f);
-    SkAutoTUnref<SkColorFilter> cf(SkColorMatrixFilter::Create(cm));
-    SkAutoTUnref<SkImageFilter> imf(SkColorFilterImageFilter::Create(cf));
+    auto cf(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat));
+    SkAutoTUnref<SkImageFilter> imf(SkColorFilterImageFilter::Create(cf.get()));
     SkPaint p;
     p.setImageFilter(imf);
     canvas->saveLayer(NULL, &p);
@@ -195,7 +192,7 @@
 };
 
 DEF_SIMPLE_GM(colorfiltershader, canvas, 800, 800) {
-    SkTRefArray<SkColorFilter*> filters;
+    SkTArray<sk_sp<SkColorFilter>> filters;
     sk_gm_get_colorfilters(&filters);
 
     SkTRefArray<SkShader*> shaders;
@@ -210,7 +207,7 @@
 
         canvas->save();
         for (int x = -1; x < filters.count(); ++x) {
-            SkColorFilter* filter = x >= 0 ? filters[x] : nullptr;
+            sk_sp<SkColorFilter> filter = x >= 0 ? filters[x] : nullptr;
 
             paint.setShader(shader->makeWithColorFilter(filter));
             canvas->drawRect(r, paint);
diff --git a/gm/colorfilters.cpp b/gm/colorfilters.cpp
index eaee39d..6352985 100644
--- a/gm/colorfilters.cpp
+++ b/gm/colorfilters.cpp
@@ -30,7 +30,7 @@
 }
 
 static void install_lighting(SkPaint* paint, uint32_t mul, uint32_t add) {
-    paint->setColorFilter(SkColorMatrixFilter::CreateLightingFilter(mul, add))->unref();
+    paint->setColorFilter(SkColorMatrixFilter::MakeLightingFilter(mul, add));
 }
 
 class ColorFiltersGM : public skiagm::GM {
diff --git a/gm/colormatrix.cpp b/gm/colormatrix.cpp
index de80ebb..8ac15db 100644
--- a/gm/colormatrix.cpp
+++ b/gm/colormatrix.cpp
@@ -14,11 +14,11 @@
 #define HEIGHT 500
 
 static void set_color_matrix(SkPaint* paint, const SkColorMatrix& matrix) {
-    paint->setColorFilter(SkColorMatrixFilter::Create(matrix))->unref();
+    paint->setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(matrix.fMat));
 }
 
 static void set_array(SkPaint* paint, const SkScalar array[]) {
-    paint->setColorFilter(SkColorMatrixFilter::Create(array))->unref();
+    paint->setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(array));
 }
 
 class ColorMatrixGM : public skiagm::GM {
diff --git a/gm/dropshadowimagefilter.cpp b/gm/dropshadowimagefilter.cpp
index 512c82d..567ef80 100644
--- a/gm/dropshadowimagefilter.cpp
+++ b/gm/dropshadowimagefilter.cpp
@@ -93,8 +93,7 @@
             draw_bitmap, draw_path, draw_paint, draw_text
         };
 
-        SkAutoTUnref<SkColorFilter> cf(
-            SkColorFilter::CreateModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcIn_Mode));
+        auto cf(SkColorFilter::MakeModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcIn_Mode));
         SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get()));
         SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)),
                                          SkImageFilter::CropRect::kHasAll_CropEdge);
diff --git a/gm/emboss.cpp b/gm/emboss.cpp
index 20d3c91..5773577 100644
--- a/gm/emboss.cpp
+++ b/gm/emboss.cpp
@@ -49,7 +49,7 @@
 
         // this combination of emboss+colorfilter used to crash -- so we exercise it to
         // confirm that we have a fix.
-        paint.setColorFilter(SkColorFilter::CreateModeFilter(0xFFFF0000, SkXfermode::kSrcATop_Mode))->unref();
+        paint.setColorFilter(SkColorFilter::MakeModeFilter(0xFFFF0000, SkXfermode::kSrcATop_Mode));
         canvas->translate(bm.width() + SkIntToScalar(10), 0);
         canvas->drawBitmap(bm, 10, 10, &paint);
     }
diff --git a/gm/fadefilter.cpp b/gm/fadefilter.cpp
index 6f64e1e..386e32b 100644
--- a/gm/fadefilter.cpp
+++ b/gm/fadefilter.cpp
@@ -15,10 +15,8 @@
                             0, 1, 0, 0, 128.0f,
                             0, 0, 1, 0, 128.0f,
                             0, 0, 0, 1, 0 };
-    SkAutoTUnref<SkColorFilter> colorFilter(
-            SkColorMatrixFilter::Create(matrix));
-    SkAutoTUnref<SkImageFilter> filter(
-            SkColorFilterImageFilter::Create(colorFilter));
+    auto colorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
+    SkAutoTUnref<SkImageFilter> filter(SkColorFilterImageFilter::Create(colorFilter.get()));
     SkPaint layerPaint;
     layerPaint.setImageFilter(filter);
     canvas->drawRect(SkRect::MakeLTRB(64, 64, 192, 192), layerPaint);
diff --git a/gm/imagefilters.cpp b/gm/imagefilters.cpp
index 24a08ff..21ce0fe 100644
--- a/gm/imagefilters.cpp
+++ b/gm/imagefilters.cpp
@@ -140,7 +140,7 @@
 DEF_SIMPLE_GM(savelayer_with_backdrop, canvas, 830, 550) {
     SkColorMatrix cm;
     cm.setSaturation(10);
-    SkAutoTUnref<SkColorFilter> cf(SkColorMatrixFilter::Create(cm));
+    auto cf(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat));
     const SkScalar kernel[] = { 4, 0, 4, 0, -15, 0, 4, 0, 4 };
     SkImageFilter* filters[] = {
         SkBlurImageFilter::Create(10, 10),
@@ -148,7 +148,7 @@
         SkMatrixConvolutionImageFilter::Create({ 3, 3 }, kernel, 1, 0, { 0, 0 },
                                            SkMatrixConvolutionImageFilter::kClampToBlack_TileMode,
                                                true),
-        SkColorFilterImageFilter::Create(cf),
+        SkColorFilterImageFilter::Create(cf.get()),
     };
 
     const struct {
diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp
index a55328a..ca8a2d4 100644
--- a/gm/imagefiltersbase.cpp
+++ b/gm/imagefiltersbase.cpp
@@ -192,18 +192,16 @@
             draw_bitmap,
         };
 
-        SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorRED,
-                                                     SkXfermode::kSrcIn_Mode);
+        auto cf = SkColorFilter::MakeModeFilter(SK_ColorRED, SkXfermode::kSrcIn_Mode);
         SkImageFilter* filters[] = {
             nullptr,
             IdentityImageFilter::Create(),
             FailImageFilter::Create(),
-            SkColorFilterImageFilter::Create(cf),
+            SkColorFilterImageFilter::Create(cf.get()),
             SkBlurImageFilter::Create(12.0f, 0.0f),
             SkDropShadowImageFilter::Create(10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLUE,
                 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode),
         };
-        cf->unref();
 
         SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));
         SkScalar MARGIN = SkIntToScalar(16);
@@ -320,7 +318,7 @@
     ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {}
 
     void installFilter(SkPaint* paint) override {
-        paint->setColorFilter(SkColorFilter::CreateModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mode))->unref();
+        paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mode));
     }
 };
 DEF_GM( return new ImageFiltersText_CF; )
diff --git a/gm/imagefilterscropexpand.cpp b/gm/imagefilterscropexpand.cpp
index f3ca4d3..ada206c 100644
--- a/gm/imagefilterscropexpand.cpp
+++ b/gm/imagefilterscropexpand.cpp
@@ -40,8 +40,6 @@
     SkISize onISize() override { return SkISize::Make(730, 650); }
 
     void onDraw(SkCanvas* canvas) override {
-        SkAutoTUnref<SkColorFilter> cf(
-            SkColorFilter::CreateModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mode));
         SkImageFilter::CropRect cropRect(
             SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)),
             SkImageFilter::CropRect::kHasAll_CropEdge);
@@ -59,7 +57,7 @@
                                 0, 1, 0, 0, sk255,
                                 0, 0, 1, 0, 0,
                                 0, 0, 0, 0, sk255 };
-        SkAutoTUnref<SkColorFilter> cfAlphaTrans(SkColorMatrixFilter::Create(matrix));
+        auto cfAlphaTrans(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
 
         SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));
         SkScalar MARGIN = SkIntToScalar(12);
@@ -80,7 +78,7 @@
             SkImageFilter::CropRect bigRect(rect, SkImageFilter::CropRect::kHasAll_CropEdge);
 
             Draw(canvas, checkerboard, rect, SkColorFilterImageFilter::Create(
-                cfAlphaTrans, noopCropped.get(), &bigRect));
+                cfAlphaTrans.get(), noopCropped.get(), &bigRect));
 
             Draw(canvas, checkerboard, rect, SkBlurImageFilter::Create(
                 0.3f, 0.3f, noopCropped.get(), &bigRect));
diff --git a/gm/imagefilterscropped.cpp b/gm/imagefilterscropped.cpp
index d39e6b0..b06761d 100644
--- a/gm/imagefilterscropped.cpp
+++ b/gm/imagefilterscropped.cpp
@@ -115,8 +115,7 @@
             draw_bitmap, draw_path, draw_paint, draw_text
         };
 
-        SkAutoTUnref<SkColorFilter> cf(
-            SkColorFilter::CreateModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mode));
+        auto cf(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mode));
         SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)), SkImageFilter::CropRect::kHasAll_CropEdge);
         SkImageFilter::CropRect bogusRect(SkRect::Make(SkIRect::MakeXYWH(-100, -100, 10, 10)), SkImageFilter::CropRect::kHasAll_CropEdge);
 
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp
index fa9c512..547a3bb 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -119,11 +119,10 @@
         canvas->clear(SK_ColorBLACK);
         {
             SkAutoTUnref<SkImageFilter> bitmapSource(SkImageSource::Create(fImage.get()));
-            SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(SK_ColorRED,
-                                                         SkXfermode::kSrcIn_Mode));
+            auto cf(SkColorFilter::MakeModeFilter(SK_ColorRED, SkXfermode::kSrcIn_Mode));
             SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(4.0f, 4.0f, bitmapSource));
             SkAutoTUnref<SkImageFilter> erode(SkErodeImageFilter::Create(4, 4, blur));
-            SkAutoTUnref<SkImageFilter> color(SkColorFilterImageFilter::Create(cf, erode));
+            SkAutoTUnref<SkImageFilter> color(SkColorFilterImageFilter::Create(cf.get(), erode));
             SkAutoTUnref<SkImageFilter> merge(SkMergeImageFilter::Create(blur, color));
 
             SkPaint paint;
@@ -139,8 +138,8 @@
                                     0, 0, SK_Scalar1, 0, 0,
                                     0, 0, 0, 0.5f, 0 };
 
-            SkAutoTUnref<SkColorFilter> matrixFilter(SkColorMatrixFilter::Create(matrix));
-            SkAutoTUnref<SkImageFilter> colorMorph(SkColorFilterImageFilter::Create(matrixFilter, morph));
+            auto matrixFilter(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
+            SkAutoTUnref<SkImageFilter> colorMorph(SkColorFilterImageFilter::Create(matrixFilter.get(), morph));
             SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(SkXfermode::kSrcOver_Mode));
             SkAutoTUnref<SkImageFilter> blendColor(SkXfermodeImageFilter::Create(mode, colorMorph));
 
@@ -154,8 +153,8 @@
                                     0, SK_Scalar1, 0, 0, 0,
                                     0, 0, SK_Scalar1, 0, 0,
                                     0, 0, 0, 0.5f, 0 };
-            SkAutoTUnref<SkColorFilter> matrixCF(SkColorMatrixFilter::Create(matrix));
-            SkAutoTUnref<SkImageFilter> matrixFilter(SkColorFilterImageFilter::Create(matrixCF));
+            auto matrixCF(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
+            SkAutoTUnref<SkImageFilter> matrixFilter(SkColorFilterImageFilter::Create(matrixCF.get()));
             SkAutoTUnref<SkImageFilter> offsetFilter(
                 SimpleOffsetFilter::Create(10.0f, 10.f, matrixFilter));
 
@@ -218,16 +217,14 @@
         }
         {
             // Test that crop offsets are absolute, not relative to the parent's crop rect.
-            SkAutoTUnref<SkColorFilter> cf1(SkColorFilter::CreateModeFilter(SK_ColorBLUE,
-                                                                            SkXfermode::kSrcIn_Mode));
-            SkAutoTUnref<SkColorFilter> cf2(SkColorFilter::CreateModeFilter(SK_ColorGREEN,
-                                                                            SkXfermode::kSrcIn_Mode));
+            auto cf1(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mode));
+            auto cf2(SkColorFilter::MakeModeFilter(SK_ColorGREEN, SkXfermode::kSrcIn_Mode));
             SkImageFilter::CropRect outerRect(SkRect::MakeXYWH(SkIntToScalar(10), SkIntToScalar(10),
                                                                SkIntToScalar(80), SkIntToScalar(80)));
             SkImageFilter::CropRect innerRect(SkRect::MakeXYWH(SkIntToScalar(20), SkIntToScalar(20),
                                                                SkIntToScalar(60), SkIntToScalar(60)));
-            SkAutoTUnref<SkImageFilter> color1(SkColorFilterImageFilter::Create(cf1, nullptr, &outerRect));
-            SkAutoTUnref<SkImageFilter> color2(SkColorFilterImageFilter::Create(cf2, color1, &innerRect));
+            SkAutoTUnref<SkImageFilter> color1(SkColorFilterImageFilter::Create(cf1.get(), nullptr, &outerRect));
+            SkAutoTUnref<SkImageFilter> color2(SkColorFilterImageFilter::Create(cf2.get(), color1, &innerRect));
 
             SkPaint paint;
             paint.setImageFilter(color2);
diff --git a/gm/lumafilter.cpp b/gm/lumafilter.cpp
index adffd00..10eefab 100644
--- a/gm/lumafilter.cpp
+++ b/gm/lumafilter.cpp
@@ -26,7 +26,7 @@
                      paint);
 }
 
-static void draw_scene(SkCanvas* canvas, SkColorFilter* filter, SkXfermode::Mode mode,
+static void draw_scene(SkCanvas* canvas, const sk_sp<SkColorFilter>& filter, SkXfermode::Mode mode,
                        const sk_sp<SkShader>& s1, const sk_sp<SkShader>& s2) {
     SkPaint paint;
     paint.setAntiAlias(true);
@@ -83,7 +83,7 @@
         SkPoint  g2Points[] = { { 0, 0 }, { kSize, 0   } };
         SkScalar pos[] = { 0.2f, 1.0f };
 
-        fFilter.reset(SkLumaColorFilter::Create());
+        fFilter = SkLumaColorFilter::Make();
         fGr1 = SkGradientShader::MakeLinear(g1Points, g1Colors, pos, SK_ARRAY_COUNT(g1Colors),
                                             SkShader::kClamp_TileMode);
         fGr2 = SkGradientShader::MakeLinear(g2Points, g2Colors, pos, SK_ARRAY_COUNT(g2Colors),
@@ -137,8 +137,8 @@
     }
 
 private:
-    SkAutoTUnref<SkColorFilter> fFilter;
-    sk_sp<SkShader>             fGr1, fGr2;
+    sk_sp<SkColorFilter>    fFilter;
+    sk_sp<SkShader>         fGr1, fGr2;
 
     typedef skiagm::GM INHERITED;
 };
diff --git a/gm/megalooper.cpp b/gm/megalooper.cpp
index 5fe9af2..6f56402 100644
--- a/gm/megalooper.cpp
+++ b/gm/megalooper.cpp
@@ -175,8 +175,7 @@
 
         paint->setMaskFilter(this->createBlur())->unref();
 
-        SkColorFilter* cf = SkColorFilter::CreateModeFilter(color, SkXfermode::kSrcIn_Mode);
-        paint->setColorFilter(cf)->unref();
+        paint->setColorFilter(SkColorFilter::MakeModeFilter(color, SkXfermode::kSrcIn_Mode));
 
         return looperBuilder.detach();
     }
@@ -222,8 +221,8 @@
 
             paint->setMaskFilter(this->createBlur())->unref();
 
-            SkColorFilter* cf = SkColorFilter::CreateModeFilter(gColors[i], SkXfermode::kSrcIn_Mode);
-            paint->setColorFilter(cf)->unref();
+            paint->setColorFilter(SkColorFilter::MakeModeFilter(gColors[i],
+                                                                SkXfermode::kSrcIn_Mode));
         }
 
         return looperBuilder.detach();
diff --git a/gm/modecolorfilters.cpp b/gm/modecolorfilters.cpp
index de6a18a..4e5d45c 100644
--- a/gm/modecolorfilters.cpp
+++ b/gm/modecolorfilters.cpp
@@ -121,9 +121,7 @@
         static const int kRectsPerRow = SkMax32(this->getISize().fWidth / kRectWidth, 1);
         for (size_t cfm = 0; cfm < SK_ARRAY_COUNT(modes); ++cfm) {
             for (size_t cfc = 0; cfc < SK_ARRAY_COUNT(colors); ++cfc) {
-                SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(colors[cfc],
-                                                                               modes[cfm]));
-                paint.setColorFilter(cf);
+                paint.setColorFilter(SkColorFilter::MakeModeFilter(colors[cfc], modes[cfm]));
                 for (size_t s = 0; s < SK_ARRAY_COUNT(shaders); ++s) {
                     paint.setShader(shaders[s]);
                     bool hasShader = nullptr == paint.getShader();
diff --git a/gm/multipicturedraw.cpp b/gm/multipicturedraw.cpp
index 1f302ee..a4b09b2 100644
--- a/gm/multipicturedraw.cpp
+++ b/gm/multipicturedraw.cpp
@@ -420,7 +420,7 @@
             step.fY = SkIntToScalar(y*kTileHeight);
             step.fPaint = new SkPaint;
             step.fPaint->setColorFilter(
-                SkColorFilter::CreateModeFilter(colors[x][y], SkXfermode::kModulate_Mode))->unref();
+                SkColorFilter::MakeModeFilter(colors[x][y], SkXfermode::kModulate_Mode));
 
             step.fSurf = create_compat_surface(finalCanvas, kTileWidth, kTileHeight);
 
diff --git a/gm/recordopts.cpp b/gm/recordopts.cpp
index 97d13cb..bac6d88 100644
--- a/gm/recordopts.cpp
+++ b/gm/recordopts.cpp
@@ -22,26 +22,26 @@
 // kDetectorGreenValue and then the incorrect value is observable by some part of the drawing
 // pipeline, that pixel will remain empty.
 
-static SkColorFilter* make_detector_color_filter() {
+static sk_sp<SkColorFilter> make_detector_color_filter() {
     uint8_t tableA[256] = { 0, };
     uint8_t tableR[256] = { 0, };
     uint8_t tableG[256] = { 0, };
     uint8_t tableB[256] = { 0, };
     tableA[255] = 255;
     tableG[kDetectorGreenValue] = 255;
-    return SkTableColorFilter::CreateARGB(tableA, tableR, tableG, tableB);
+    return SkTableColorFilter::MakeARGB(tableA, tableR, tableG, tableB);
 }
 
 // This detector detects that color filter phase of the pixel pipeline receives the correct value.
 static void install_detector_color_filter(SkPaint* drawPaint) {
-    drawPaint->setColorFilter(make_detector_color_filter())->unref();
+    drawPaint->setColorFilter(make_detector_color_filter());
 }
 
 // This detector detects that image filter phase of the pixel pipeline receives the correct value.
 static void install_detector_image_filter(SkPaint* drawPaint) {
-    SkAutoTUnref<SkColorFilter> colorFilter(make_detector_color_filter());
+    auto colorFilter(make_detector_color_filter());
     SkImageFilter* imageFilter =
-            SkColorFilterImageFilter::Create(colorFilter, drawPaint->getImageFilter());
+            SkColorFilterImageFilter::Create(colorFilter.get(), drawPaint->getImageFilter());
     drawPaint->setImageFilter(imageFilter)->unref();
 }
 
diff --git a/gm/skbug1719.cpp b/gm/skbug1719.cpp
index 23c0c5f..3358de5 100644
--- a/gm/skbug1719.cpp
+++ b/gm/skbug1719.cpp
@@ -64,8 +64,7 @@
             SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
                                      0.78867501f,
                                      SkBlurMaskFilter::kHighQuality_BlurFlag))->unref();
-        paint.setColorFilter(
-            SkColorFilter::CreateModeFilter(0xBFFFFFFF, SkXfermode::kSrcIn_Mode))->unref();
+        paint.setColorFilter(SkColorFilter::MakeModeFilter(0xBFFFFFFF, SkXfermode::kSrcIn_Mode));
 
         canvas->clipPath(clipPath, SkRegion::kIntersect_Op, true);
         canvas->drawPath(drawPath, paint);
diff --git a/gm/tablecolorfilter.cpp b/gm/tablecolorfilter.cpp
index dcc29f3..c9ca474 100644
--- a/gm/tablecolorfilter.cpp
+++ b/gm/tablecolorfilter.cpp
@@ -73,27 +73,27 @@
     }
 }
 
-static SkColorFilter* make_null_cf() {
+static sk_sp<SkColorFilter> make_null_cf() {
     return nullptr;
 }
 
-static SkColorFilter* make_cf0() {
+static sk_sp<SkColorFilter> make_cf0() {
     uint8_t table[256]; make_table0(table);
-    return SkTableColorFilter::Create(table);
+    return SkTableColorFilter::Make(table);
 }
-static SkColorFilter* make_cf1() {
+static sk_sp<SkColorFilter> make_cf1() {
     uint8_t table[256]; make_table1(table);
-    return SkTableColorFilter::Create(table);
+    return SkTableColorFilter::Make(table);
 }
-static SkColorFilter* make_cf2() {
+static sk_sp<SkColorFilter> make_cf2() {
     uint8_t table[256]; make_table2(table);
-    return SkTableColorFilter::Create(table);
+    return SkTableColorFilter::Make(table);
 }
-static SkColorFilter* make_cf3() {
+static sk_sp<SkColorFilter> make_cf3() {
     uint8_t table0[256]; make_table0(table0);
     uint8_t table1[256]; make_table1(table1);
     uint8_t table2[256]; make_table2(table2);
-    return SkTableColorFilter::CreateARGB(nullptr, table0, table1, table2);
+    return SkTableColorFilter::MakeARGB(nullptr, table0, table1, table2);
 }
 
 class TableColorFilterGM : public skiagm::GM {
@@ -114,8 +114,9 @@
         canvas->translate(20, 20);
 
 
-        static SkColorFilter* (*gColorFilterMakers[])() = { make_null_cf, make_cf0, make_cf1,
-                                                 make_cf2, make_cf3 };
+        static sk_sp<SkColorFilter> (*gColorFilterMakers[])() = {
+            make_null_cf, make_cf0, make_cf1, make_cf2, make_cf3
+        };
         static void (*gBitmapMakers[])(SkBitmap*) = { make_bm0, make_bm1 };
 
         // This test will be done once for each bitmap with the results stacked vertically.
@@ -155,25 +156,25 @@
             // each draw being at xOffset of the previous one
             for (unsigned i = 1; i < SK_ARRAY_COUNT(gColorFilterMakers); ++i) {
                 x += xOffset;
-                paint.setColorFilter(gColorFilterMakers[i]())->unref();
+                paint.setColorFilter(gColorFilterMakers[i]());
                 canvas->drawBitmap(bm, x, y, &paint);
             }
 
             paint.setColorFilter(nullptr);
 
             for (unsigned i = 0; i < SK_ARRAY_COUNT(gColorFilterMakers); ++i) {
-                SkAutoTUnref<SkColorFilter> colorFilter1(gColorFilterMakers[i]());
+                auto colorFilter1(gColorFilterMakers[i]());
                 SkAutoTUnref<SkImageFilter> imageFilter1(SkColorFilterImageFilter::Create(
-                            colorFilter1, nullptr, nullptr));
+                            colorFilter1.get(), nullptr, nullptr));
 
                 // Move down to the next line and draw it
                 // each draw being at xOffset of the previous one
                 y += yOffset;
                 x = 0;
                 for (unsigned j = 1; j < SK_ARRAY_COUNT(gColorFilterMakers); ++j) {
-                    SkAutoTUnref<SkColorFilter> colorFilter2(gColorFilterMakers[j]());
+                    auto colorFilter2(gColorFilterMakers[j]());
                     SkAutoTUnref<SkImageFilter> imageFilter2(SkColorFilterImageFilter::Create(
-                                colorFilter2, imageFilter1, nullptr));
+                                colorFilter2.get(), imageFilter1, nullptr));
                     paint.setImageFilter(imageFilter2);
                     canvas->drawBitmap(bm, x, y, &paint);
                     x += xOffset;
@@ -225,11 +226,11 @@
         canvas->drawColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
 
         const int MODES = MODE_COUNT * COLOR_COUNT;
-        SkAutoTUnref<SkColorFilter> filters[MODES];
+        sk_sp<SkColorFilter> filters[MODES];
         int index = 0;
         for (int i = 0; i < MODE_COUNT; ++i) {
             for (int j = 0; j < COLOR_COUNT; ++j) {
-                filters[index++].reset(SkColorFilter::CreateModeFilter(fColors[j], fModes[i]));
+                filters[index++] = SkColorFilter::MakeModeFilter(fColors[j], fModes[i]);
             }
         }
 
@@ -261,9 +262,7 @@
         for (int y = 0; y < MODES; ++y) {
             canvas->save();
             for (int x = 0; x < MODES; ++x) {
-                SkAutoTUnref<SkColorFilter> compose(SkColorFilter::CreateComposeFilter(filters[y],
-                                                                                       filters[x]));
-                paint.setColorFilter(compose);
+                paint.setColorFilter(SkColorFilter::MakeComposeFilter(filters[y], filters[x]));
                 canvas->drawRect(r, paint);
                 canvas->translate(r.width() + spacer, 0);
             }
diff --git a/gm/testimagefilters.cpp b/gm/testimagefilters.cpp
index 1ea9575..465d606 100644
--- a/gm/testimagefilters.cpp
+++ b/gm/testimagefilters.cpp
@@ -24,10 +24,8 @@
 static SkImageFilter* make0() { return SkDownSampleImageFilter::Create(SK_Scalar1 / 5); }
 static SkImageFilter* make1() { return SkOffsetImageFilter::Create(SkIntToScalar(16), SkIntToScalar(16)); }
 static SkImageFilter* make2() {
-    SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorBLUE,
-                                                        SkXfermode::kSrcIn_Mode);
-    SkAutoUnref aur(cf);
-    return SkColorFilterImageFilter::Create(cf);
+    auto cf = SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mode);
+    return SkColorFilterImageFilter::Create(cf.get());
 }
 static SkImageFilter* make3() {
     return SkBlurImageFilter::Create(8, 0);
@@ -56,10 +54,8 @@
     SkImageFilter* compose = SkComposeImageFilter::Create(outer, inner);
     SkAutoUnref aur2(compose);
 
-    SkColorFilter* cf = SkColorFilter::CreateModeFilter(0x880000FF,
-                                                        SkXfermode::kSrcIn_Mode);
-    SkAutoUnref aur3(cf);
-    SkImageFilter* blue = SkColorFilterImageFilter::Create(cf);
+    auto cf = SkColorFilter::MakeModeFilter(0x880000FF, SkXfermode::kSrcIn_Mode);
+    SkImageFilter* blue = SkColorFilterImageFilter::Create(cf.get());
     SkAutoUnref aur4(blue);
 
     return SkMergeImageFilter::Create(compose, blue);
@@ -73,10 +69,8 @@
     SkImageFilter* compose = SkComposeImageFilter::Create(outer, inner);
     SkAutoUnref aur2(compose);
 
-    SkColorFilter* cf = SkColorFilter::CreateModeFilter(0x880000FF,
-                                                        SkXfermode::kSrcIn_Mode);
-    SkAutoUnref aur3(cf);
-    SkImageFilter* blue = SkColorFilterImageFilter::Create(cf);
+    auto cf = SkColorFilter::MakeModeFilter(0x880000FF, SkXfermode::kSrcIn_Mode);
+    SkImageFilter* blue = SkColorFilterImageFilter::Create(cf.get());
     SkAutoUnref aur4(blue);
 
     return SkMergeImageFilter::Create(compose, blue);
diff --git a/gm/textbloblooper.cpp b/gm/textbloblooper.cpp
index d970113..ac8b7c9 100644
--- a/gm/textbloblooper.cpp
+++ b/gm/textbloblooper.cpp
@@ -97,7 +97,7 @@
     SkRect r;
     r.setWH(SkIntToScalar(kWidth), 50);
     paint->setShader(make_shader(r));
-    paint->setColorFilter(SkColorMatrixFilter::CreateLightingFilter(0xF0F0F0, 0))->unref();
+    paint->setColorFilter(SkColorMatrixFilter::MakeLightingFilter(0xF0F0F0, 0));
 }
 
 static void kitchen_sink(SkPaint* paint) {
diff --git a/gm/tileimagefilter.cpp b/gm/tileimagefilter.cpp
index cf8825e..f75e7f9 100644
--- a/gm/tileimagefilter.cpp
+++ b/gm/tileimagefilter.cpp
@@ -93,9 +93,9 @@
         SkRect dstRect = SkRect::MakeWH(SkIntToScalar(fBitmap->width() * 2),
                                         SkIntToScalar(fBitmap->height() * 2));
         SkAutoTUnref<SkImageFilter> tile(SkTileImageFilter::Create(srcRect, dstRect, nullptr));
-        SkAutoTUnref<SkColorFilter> cf(SkColorMatrixFilter::Create(matrix));
+        auto cf(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
 
-        SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf, tile.get()));
+        SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get(), tile.get()));
         SkPaint paint;
         paint.setImageFilter(cfif);
         canvas->save();
diff --git a/gm/vertices.cpp b/gm/vertices.cpp
index 177dc43..9c4ccc1 100644
--- a/gm/vertices.cpp
+++ b/gm/vertices.cpp
@@ -26,17 +26,17 @@
     return SkShader::MakeColorShader(SK_ColorBLUE);
 }
 
-static SkColorFilter* make_color_filter() {
-    return SkColorFilter::CreateModeFilter(0xFFAABBCC, SkXfermode::kDarken_Mode);
+static sk_sp<SkColorFilter> make_color_filter() {
+    return SkColorFilter::MakeModeFilter(0xFFAABBCC, SkXfermode::kDarken_Mode);
 }
 
 class VerticesGM : public skiagm::GM {
-    SkPoint                     fPts[9];
-    SkPoint                     fTexs[9];
-    SkColor                     fColors[9];
-    sk_sp<SkShader>             fShader1;
-    sk_sp<SkShader>             fShader2;
-    SkAutoTUnref<SkColorFilter> fColorFilter;
+    SkPoint                 fPts[9];
+    SkPoint                 fTexs[9];
+    SkColor                 fColors[9];
+    sk_sp<SkShader>         fShader1;
+    sk_sp<SkShader>         fShader2;
+    sk_sp<SkColorFilter>    fColorFilter;
 
 public:
     VerticesGM() {}
@@ -60,7 +60,7 @@
 
         fShader1 = make_shader1(w, h);
         fShader2 = make_shader2();
-        fColorFilter.reset(make_color_filter());
+        fColorFilter = make_color_filter();
 
         SkRandom rand;
         for (size_t i = 0; i < SK_ARRAY_COUNT(fColors); ++i) {
@@ -85,11 +85,11 @@
         };
 
         const struct {
-            const SkColor*          fColors;
-            const SkPoint*          fTexs;
-            const sk_sp<SkShader>&  fShader;
-            SkColorFilter*          fColorFilter;
-            uint8_t                 fAlpha;
+            const SkColor*              fColors;
+            const SkPoint*              fTexs;
+            const sk_sp<SkShader>&      fShader;
+            const sk_sp<SkColorFilter>& fColorFilter;
+            uint8_t                     fAlpha;
         } rec[] = {
             { fColors,  nullptr, fShader1, nullptr     , 0xFF },
             { nullptr,  fTexs  , fShader1, nullptr     , 0xFF },