Index: tests/SkResourceCacheTest.cpp |
diff --git a/tests/SkResourceCacheTest.cpp b/tests/SkResourceCacheTest.cpp |
index 3c0d1ffee3a467d00c6e35545a3ed1b003c73942..f363fb7a44b72cd894fa07abc897ea37d29ecf21 100644 |
--- a/tests/SkResourceCacheTest.cpp |
+++ b/tests/SkResourceCacheTest.cpp |
@@ -96,14 +96,18 @@ static void test_mipmapcache(skiatest::Reporter* reporter, SkResourceCache* cach |
src.allocN32Pixels(5, 5); |
src.setImmutable(); |
- const SkMipMap* mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), cache); |
+ const SkSourceGammaTreatment treatment = SkSourceGammaTreatment::kIgnore; |
+ |
+ const SkMipMap* mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), treatment, |
+ cache); |
REPORTER_ASSERT(reporter, nullptr == mipmap); |
- mipmap = SkMipMapCache::AddAndRef(src, cache); |
+ mipmap = SkMipMapCache::AddAndRef(src, treatment, cache); |
REPORTER_ASSERT(reporter, mipmap); |
{ |
- const SkMipMap* mm = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), cache); |
+ const SkMipMap* mm = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), treatment, |
+ cache); |
REPORTER_ASSERT(reporter, mm); |
REPORTER_ASSERT(reporter, mm == mipmap); |
mm->unref(); |
@@ -117,7 +121,7 @@ static void test_mipmapcache(skiatest::Reporter* reporter, SkResourceCache* cach |
check_data(reporter, mipmap, 1, kInCache, kNotLocked); |
// find us again |
- mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), cache); |
+ mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), treatment, cache); |
check_data(reporter, mipmap, 2, kInCache, kLocked); |
cache->purgeAll(); |
@@ -127,16 +131,19 @@ static void test_mipmapcache(skiatest::Reporter* reporter, SkResourceCache* cach |
} |
static void test_mipmap_notify(skiatest::Reporter* reporter, SkResourceCache* cache) { |
+ const SkSourceGammaTreatment treatment = SkSourceGammaTreatment::kIgnore; |
const int N = 3; |
+ |
SkBitmap src[N]; |
for (int i = 0; i < N; ++i) { |
src[i].allocN32Pixels(5, 5); |
src[i].setImmutable(); |
- SkMipMapCache::AddAndRef(src[i], cache)->unref(); |
+ SkMipMapCache::AddAndRef(src[i], treatment, cache)->unref(); |
} |
for (int i = 0; i < N; ++i) { |
- const SkMipMap* mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src[i]), cache); |
+ const SkMipMap* mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src[i]), |
+ treatment, cache); |
if (cache) { |
// if cache is null, we're working on the global cache, and other threads might purge |
// it, making this check fragile. |
@@ -146,7 +153,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(SkBitmapCacheDesc::Make(src[i]), cache); |
+ mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src[i]), treatment, cache); |
REPORTER_ASSERT(reporter, !mipmap); |
} |
} |