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

Unified Diff: tests/SkResourceCacheTest.cpp

Issue 1340223003: create SkBitmapProvider to abstract images and bitmaps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove obsolete comments Created 5 years, 3 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
« no previous file with comments | « src/core/SkBitmapController.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « src/core/SkBitmapController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698