Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: gm/imagefiltersgraph.cpp

Issue 1832223002: switch xfermodes over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gm/imagefiltersgraph.cpp
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp
index 547a3bbbe229c8ce3a9fdfd2162c8ce730609afc..53343bc3d07942751d42565c162459308c226202 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -140,11 +140,10 @@ protected:
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));
-
SkPaint paint;
- paint.setImageFilter(blendColor);
+ paint.setImageFilter(SkXfermodeImageFilter::Make(
+ SkXfermode::Make(SkXfermode::kSrcOver_Mode), colorMorph));
+
DrawClippedImage(canvas, fImage.get(), paint);
canvas->translate(SkIntToScalar(100), 0);
}
@@ -158,12 +157,11 @@ protected:
SkAutoTUnref<SkImageFilter> offsetFilter(
SimpleOffsetFilter::Create(10.0f, 10.f, matrixFilter));
- SkAutoTUnref<SkXfermode> arith(SkArithmeticMode::Create(0, SK_Scalar1, SK_Scalar1, 0));
- SkAutoTUnref<SkImageFilter> arithFilter(
- SkXfermodeImageFilter::Create(arith, matrixFilter, offsetFilter));
-
SkPaint paint;
- paint.setImageFilter(arithFilter);
+ paint.setImageFilter(
+ SkXfermodeImageFilter::Make(SkArithmeticMode::Make(0, SK_Scalar1, SK_Scalar1, 0),
+ matrixFilter, offsetFilter, nullptr));
+
DrawClippedImage(canvas, fImage.get(), paint);
canvas->translate(SkIntToScalar(100), 0);
}
@@ -171,13 +169,11 @@ protected:
SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(
SkIntToScalar(10), SkIntToScalar(10)));
- SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(SkXfermode::kSrcIn_Mode));
SkImageFilter::CropRect cropRect(SkRect::MakeWH(SkIntToScalar(95), SkIntToScalar(100)));
- SkAutoTUnref<SkImageFilter> blend(
- SkXfermodeImageFilter::Create(mode, blur, nullptr, &cropRect));
-
SkPaint paint;
- paint.setImageFilter(blend);
+ paint.setImageFilter(
+ SkXfermodeImageFilter::Make(SkXfermode::Make(SkXfermode::kSrcIn_Mode), blur,
+ nullptr, &cropRect));
DrawClippedImage(canvas, fImage.get(), paint);
canvas->translate(SkIntToScalar(100), 0);
}
@@ -188,8 +184,6 @@ protected:
// (supplied by the dilate).
SkAutoTUnref<SkImageFilter> dilate(SkDilateImageFilter::Create(5, 5));
- SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(SkXfermode::kSrcIn_Mode));
-
SkScalar kernel[9] = {
SkIntToScalar(-1), SkIntToScalar( -1 ), SkIntToScalar(-1),
SkIntToScalar(-1), SkIntToScalar( 7 ), SkIntToScalar(-1),
« no previous file with comments | « gm/hairmodes.cpp ('k') | gm/lcdblendmodes.cpp » ('j') | include/effects/SkXfermodeImageFilter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698