diff options
author | reed <reed@google.com> | 2015-09-15 12:38:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-15 12:38:12 -0700 |
commit | 98ed7b6d01c16ad9ace652ec25861689d765d0b5 (patch) | |
tree | 7411c0b673c6af47cd4b478f6fdb4a3f665f224f /tests/SkResourceCacheTest.cpp | |
parent | 5598b63cd2443a608a74a222d0206bb2455383b7 (diff) |
create SkBitmapProvider to abstract images and bitmaps
BUG=skia:
Review URL: https://codereview.chromium.org/1340223003
Diffstat (limited to 'tests/SkResourceCacheTest.cpp')
-rw-r--r-- | tests/SkResourceCacheTest.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/SkResourceCacheTest.cpp b/tests/SkResourceCacheTest.cpp index cf8327fcde..9df15192d8 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); } } |