| Index: gm/color4f.cpp
|
| diff --git a/gm/color4f.cpp b/gm/color4f.cpp
|
| index 2d5b7d2c1ae09a31e4d1f704916828b4941126db..ec9bbcbfba9b3056fd7f4b672a27413091ab15f8 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);
|
| }
|
|
|