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

Unified Diff: tests/ResourceCacheTest.cpp

Issue 2206633004: Move off SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gotta catch 'em all. Created 4 years, 4 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/ResourceCacheTest.cpp
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index bd2bb2f094e85e840f503dd26a7bb2e7d374c46f..289fdd9eb8285cd456c176b9f30cfbb05a90f057 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -871,8 +871,7 @@ static void test_duplicate_unique_key(skiatest::Reporter* reporter) {
make_unique_key<0>(&key2, 0);
SkAutoTUnref<TestResource> d(new TestResource(context->getGpu()));
int foo = 4132;
- SkAutoTUnref<SkData> data(SkData::NewWithCopy(&foo, sizeof(foo)));
- key2.setCustomData(data.get());
+ key2.setCustomData(SkData::MakeWithCopy(&foo, sizeof(foo)));
d->resourcePriv().setUniqueKey(key2);
}
@@ -1262,8 +1261,7 @@ static void test_custom_data(skiatest::Reporter* reporter) {
make_unique_key<0>(&key1, 1);
make_unique_key<0>(&key2, 2);
int foo = 4132;
- SkAutoTUnref<SkData> data(SkData::NewWithCopy(&foo, sizeof(foo)));
- key1.setCustomData(data.get());
+ key1.setCustomData(SkData::MakeWithCopy(&foo, sizeof(foo)));
REPORTER_ASSERT(reporter, *(int*) key1.getCustomData()->data() == 4132);
REPORTER_ASSERT(reporter, key2.getCustomData() == nullptr);
@@ -1283,7 +1281,7 @@ static void test_abandoned(skiatest::Reporter* reporter) {
// Call all the public methods on resource in the abandoned state. They shouldn't crash.
int foo = 4132;
- SkAutoTUnref<SkData> data(SkData::NewWithCopy(&foo, sizeof(foo)));
+ sk_sp<SkData> data(SkData::MakeWithCopy(&foo, sizeof(foo)));
resource->setCustomData(data.get());
resource->getCustomData();
resource->getUniqueID();
« include/core/SkData.h ('K') | « tests/PictureTest.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698