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

Unified Diff: tests/XfermodeTest.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/XfermodeTest.cpp
diff --git a/tests/XfermodeTest.cpp b/tests/XfermodeTest.cpp
index 294d63db59adb490f4045d2752f1660c467bd8ce..c3a4d967852308fe147880fd5754fe3ed768c85c 100644
--- a/tests/XfermodeTest.cpp
+++ b/tests/XfermodeTest.cpp
@@ -13,7 +13,7 @@
static void test_asMode(skiatest::Reporter* reporter) {
for (int mode = 0; mode <= SkXfermode::kLastMode; mode++) {
- SkXfermode* xfer = SkXfermode::Create((SkXfermode::Mode) mode);
+ auto xfer = SkXfermode::Make((SkXfermode::Mode) mode);
SkXfermode::Mode reportedMode = ILLEGAL_MODE;
REPORTER_ASSERT(reporter, reportedMode != mode);
@@ -27,7 +27,6 @@ static void test_asMode(skiatest::Reporter* reporter) {
reportedMode = (SkXfermode::Mode) -1;
REPORTER_ASSERT(reporter, xfer->asMode(&reportedMode));
REPORTER_ASSERT(reporter, reportedMode == mode);
- xfer->unref();
} else {
REPORTER_ASSERT(reporter, SkXfermode::kSrcOver_Mode == mode);
}
@@ -41,9 +40,8 @@ static void test_IsMode(skiatest::Reporter* reporter) {
for (int i = 0; i <= SkXfermode::kLastMode; ++i) {
SkXfermode::Mode mode = (SkXfermode::Mode)i;
- SkXfermode* xfer = SkXfermode::Create(mode);
+ auto xfer = SkXfermode::Make(mode);
REPORTER_ASSERT(reporter, SkXfermode::IsMode(xfer, mode));
- SkSafeUnref(xfer);
if (SkXfermode::kSrcOver_Mode != mode) {
REPORTER_ASSERT(reporter, !SkXfermode::IsMode(nullptr, mode));

Powered by Google App Engine
This is Rietveld 408576698