Index: tests/SkResourceCacheTest.cpp |
diff --git a/tests/SkResourceCacheTest.cpp b/tests/SkResourceCacheTest.cpp |
index cf8327fcdeccd8b2d135bcfa5fae29da70fa7f87..9df15192d86670b2dfd8cf11263b70d6e0f4a26c 100644 |
--- a/tests/SkResourceCacheTest.cpp |
+++ b/tests/SkResourceCacheTest.cpp |
@@ -23,7 +23,7 @@ static bool is_in_scaled_image_cache(const SkBitmap& orig, |
SkBitmap scaled; |
int width = SkScalarRoundToInt(orig.width() * xScale); |
int height = SkScalarRoundToInt(orig.height() * yScale); |
- return SkBitmapCache::FindWH(orig, width, height, &scaled); |
+ return SkBitmapCache::FindWH(SkBitmapCacheDesc::Make(orig, width, height), &scaled); |
} |
// Draw a scaled bitmap, then return true if it has been cached. |
@@ -153,14 +153,14 @@ static void test_mipmapcache(skiatest::Reporter* reporter, SkResourceCache* cach |
src.allocN32Pixels(5, 5); |
src.setImmutable(); |
- const SkMipMap* mipmap = SkMipMapCache::FindAndRef(src, cache); |
+ const SkMipMap* mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), cache); |
REPORTER_ASSERT(reporter, nullptr == mipmap); |
mipmap = SkMipMapCache::AddAndRef(src, cache); |
REPORTER_ASSERT(reporter, mipmap); |
{ |
- const SkMipMap* mm = SkMipMapCache::FindAndRef(src, cache); |
+ const SkMipMap* mm = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), cache); |
REPORTER_ASSERT(reporter, mm); |
REPORTER_ASSERT(reporter, mm == mipmap); |
mm->unref(); |
@@ -174,7 +174,7 @@ static void test_mipmapcache(skiatest::Reporter* reporter, SkResourceCache* cach |
check_data(reporter, mipmap, 1, kInCache, kNotLocked); |
// find us again |
- mipmap = SkMipMapCache::FindAndRef(src, cache); |
+ mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), cache); |
check_data(reporter, mipmap, 2, kInCache, kLocked); |
cache->purgeAll(); |
@@ -193,7 +193,7 @@ static void test_mipmap_notify(skiatest::Reporter* reporter, SkResourceCache* ca |
} |
for (int i = 0; i < N; ++i) { |
- const SkMipMap* mipmap = SkMipMapCache::FindAndRef(src[i], cache); |
+ const SkMipMap* mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src[i]), cache); |
if (cache) { |
// if cache is null, we're working on the global cache, and other threads might purge |
// it, making this check fragile. |
@@ -203,7 +203,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(src[i], cache); |
+ mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src[i]), cache); |
REPORTER_ASSERT(reporter, !mipmap); |
} |
} |