diff options
author | 2016-08-02 14:40:46 -0700 | |
---|---|---|
committer | 2016-08-02 14:40:46 -0700 | |
commit | 38d909ec2875f79952de08f36adfaac5680d2c53 (patch) | |
tree | a11067146b42f3faa8531d6ef912f7246bbde1f2 /tests/ResourceCacheTest.cpp | |
parent | ada5a44f3bdac10a8a0c53b34f5add7aea9fdbb0 (diff) |
Move off SK_SUPPORT_LEGACY_DATA_FACTORIES.
This moves Skia code off of SK_SUPPORT_LEGACY_DATA_FACTORIES.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2206633004
Review-Url: https://codereview.chromium.org/2206633004
Diffstat (limited to 'tests/ResourceCacheTest.cpp')
-rw-r--r-- | tests/ResourceCacheTest.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp index bd2bb2f094..289fdd9eb8 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(); |