aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkResourceCacheTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/SkResourceCacheTest.cpp')
-rw-r--r--tests/SkResourceCacheTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/SkResourceCacheTest.cpp b/tests/SkResourceCacheTest.cpp
index b260d89503..542d80efff 100644
--- a/tests/SkResourceCacheTest.cpp
+++ b/tests/SkResourceCacheTest.cpp
@@ -89,8 +89,8 @@ static void test_mipmap_notify(skiatest::Reporter* reporter, SkResourceCache* ca
}
for (int i = 0; i < N; ++i) {
- const auto desc = SkBitmapCacheDesc::Make(src[i]);
- const SkMipMap* mipmap = SkMipMapCache::FindAndRef(desc, colorMode, cache);
+ const SkMipMap* mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src[i]),
+ colorMode, cache);
if (cache) {
// if cache is null, we're working on the global cache, and other threads might purge
// it, making this check fragile.
@@ -100,7 +100,7 @@ static void test_mipmap_notify(skiatest::Reporter* reporter, SkResourceCache* ca
src[i].reset(); // delete the underlying pixelref, which *should* remove us from the cache
- mipmap = SkMipMapCache::FindAndRef(desc, colorMode, cache);
+ mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src[i]), colorMode, cache);
REPORTER_ASSERT(reporter, !mipmap);
}
}
@@ -156,14 +156,14 @@ static void test_discarded_image(skiatest::Reporter* reporter, const SkMatrix& t
canvas->concat(transform);
canvas->drawImage(image, 0, 0, &paint);
- const auto desc = SkBitmapCacheDesc::Make(image.get());
+ auto imageId = image->uniqueID();
// delete the image
image.reset(nullptr);
// all resources should have been purged
SkBitmap result;
- REPORTER_ASSERT(reporter, !SkBitmapCache::Find(desc, &result));
+ REPORTER_ASSERT(reporter, !SkBitmapCache::Find(imageId, &result));
}
}