From d6889293dd0942f27f9593f679722c956831f2c4 Mon Sep 17 00:00:00 2001 From: reed Date: Tue, 22 Mar 2016 08:59:19 -0700 Subject: 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/ ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Review URL: https://codereview.chromium.org/1821103004 --- gm/imagefiltersgraph.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'gm/imagefiltersgraph.cpp') diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp index 547a3bbbe2..fa9c512591 100644 --- a/gm/imagefiltersgraph.cpp +++ b/gm/imagefiltersgraph.cpp @@ -119,10 +119,11 @@ protected: canvas->clear(SK_ColorBLACK); { SkAutoTUnref bitmapSource(SkImageSource::Create(fImage.get())); - auto cf(SkColorFilter::MakeModeFilter(SK_ColorRED, SkXfermode::kSrcIn_Mode)); + SkAutoTUnref cf(SkColorFilter::CreateModeFilter(SK_ColorRED, + SkXfermode::kSrcIn_Mode)); SkAutoTUnref blur(SkBlurImageFilter::Create(4.0f, 4.0f, bitmapSource)); SkAutoTUnref erode(SkErodeImageFilter::Create(4, 4, blur)); - SkAutoTUnref color(SkColorFilterImageFilter::Create(cf.get(), erode)); + SkAutoTUnref color(SkColorFilterImageFilter::Create(cf, erode)); SkAutoTUnref merge(SkMergeImageFilter::Create(blur, color)); SkPaint paint; @@ -138,8 +139,8 @@ protected: 0, 0, SK_Scalar1, 0, 0, 0, 0, 0, 0.5f, 0 }; - auto matrixFilter(SkColorFilter::MakeMatrixFilterRowMajor255(matrix)); - SkAutoTUnref colorMorph(SkColorFilterImageFilter::Create(matrixFilter.get(), morph)); + SkAutoTUnref matrixFilter(SkColorMatrixFilter::Create(matrix)); + SkAutoTUnref colorMorph(SkColorFilterImageFilter::Create(matrixFilter, morph)); SkAutoTUnref mode(SkXfermode::Create(SkXfermode::kSrcOver_Mode)); SkAutoTUnref blendColor(SkXfermodeImageFilter::Create(mode, colorMorph)); @@ -153,8 +154,8 @@ protected: 0, SK_Scalar1, 0, 0, 0, 0, 0, SK_Scalar1, 0, 0, 0, 0, 0, 0.5f, 0 }; - auto matrixCF(SkColorFilter::MakeMatrixFilterRowMajor255(matrix)); - SkAutoTUnref matrixFilter(SkColorFilterImageFilter::Create(matrixCF.get())); + SkAutoTUnref matrixCF(SkColorMatrixFilter::Create(matrix)); + SkAutoTUnref matrixFilter(SkColorFilterImageFilter::Create(matrixCF)); SkAutoTUnref offsetFilter( SimpleOffsetFilter::Create(10.0f, 10.f, matrixFilter)); @@ -217,14 +218,16 @@ protected: } { // Test that crop offsets are absolute, not relative to the parent's crop rect. - auto cf1(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mode)); - auto cf2(SkColorFilter::MakeModeFilter(SK_ColorGREEN, SkXfermode::kSrcIn_Mode)); + SkAutoTUnref cf1(SkColorFilter::CreateModeFilter(SK_ColorBLUE, + SkXfermode::kSrcIn_Mode)); + SkAutoTUnref cf2(SkColorFilter::CreateModeFilter(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 color1(SkColorFilterImageFilter::Create(cf1.get(), nullptr, &outerRect)); - SkAutoTUnref color2(SkColorFilterImageFilter::Create(cf2.get(), color1, &innerRect)); + SkAutoTUnref color1(SkColorFilterImageFilter::Create(cf1, nullptr, &outerRect)); + SkAutoTUnref color2(SkColorFilterImageFilter::Create(cf2, color1, &innerRect)); SkPaint paint; paint.setImageFilter(color2); -- cgit v1.2.3