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

Unified Diff: gm/imagefiltersgraph.cpp

Issue 1822623002: switch colorfilters 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
« no previous file with comments | « gm/imagefilterscropped.cpp ('k') | gm/lumafilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersgraph.cpp
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp
index fa9c512591a06d9130b01bc0b4b3aabf922332cb..547a3bbbe229c8ce3a9fdfd2162c8ce730609afc 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -119,11 +119,10 @@ protected:
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 @@ protected:
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 @@ protected:
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 @@ protected:
}
{
// 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);
« no previous file with comments | « gm/imagefilterscropped.cpp ('k') | gm/lumafilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698