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

Unified Diff: tests/SerializationTest.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: tests/SerializationTest.cpp
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index f6b1275f00c92fc3a028a147511e6d2e37a4084b..6914a498a49b32ee5de173bb59533564503b3dd6 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -246,13 +246,13 @@ static void TestBitmapSerialization(const SkBitmap& validBitmap,
SkAutoTUnref<SkImageFilter> validBitmapSource(SkImageSource::Create(validImage.get()));
sk_sp<SkImage> invalidImage(SkImage::MakeFromBitmap(invalidBitmap));
SkAutoTUnref<SkImageFilter> invalidBitmapSource(SkImageSource::Create(invalidImage.get()));
- SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(SkXfermode::kSrcOver_Mode));
- SkAutoTUnref<SkImageFilter> xfermodeImageFilter(
- SkXfermodeImageFilter::Create(mode, invalidBitmapSource, validBitmapSource));
+ sk_sp<SkImageFilter> xfermodeImageFilter(
+ SkXfermodeImageFilter::Make(SkXfermode::Make(SkXfermode::kSrcOver_Mode),
+ invalidBitmapSource, validBitmapSource, nullptr));
SkAutoTUnref<SkImageFilter> deserializedFilter(
TestFlattenableSerialization<SkImageFilter>(
- xfermodeImageFilter, shouldSucceed, reporter));
+ xfermodeImageFilter.get(), shouldSucceed, reporter));
// Try to render a small bitmap using the invalid deserialized filter
// to make sure we don't crash while trying to render it
@@ -274,8 +274,8 @@ static void TestXfermodeSerialization(skiatest::Reporter* reporter) {
// skip SrcOver, as it is allowed to return nullptr from Create()
continue;
}
- SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(static_cast<SkXfermode::Mode>(i)));
- REPORTER_ASSERT(reporter, mode.get());
+ auto mode(SkXfermode::Make(static_cast<SkXfermode::Mode>(i)));
+ REPORTER_ASSERT(reporter, mode);
SkAutoTUnref<SkXfermode> copy(
TestFlattenableSerialization<SkXfermode>(mode.get(), true, reporter));
}

Powered by Google App Engine
This is Rietveld 408576698