diff options
author | Brian Osman <brianosman@google.com> | 2016-11-08 17:08:54 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-09 01:05:07 +0000 |
commit | 7b8400dad2f82dcc6ed3c7cc1707ebaf85f04840 (patch) | |
tree | dc1e131776fb1922b113f1a5e723205d8c13ccfe /tests | |
parent | c8b15684fe5b5b924b90091fedfbedf2806535e0 (diff) |
Rename SkSourceGammaTreatment to SkDestinationSurfaceColorMode
This is much more explicit about what that type represents (are we in
legacy mode or not), which also makes it suitable for other (upcoming)
usage.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4529
Change-Id: Iacb397c34e7765f1ca86c0195bc622b2be4d9acf
Reviewed-on: https://skia-review.googlesource.com/4529
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/MipMapTest.cpp | 6 | ||||
-rw-r--r-- | tests/ResourceCacheTest.cpp | 2 | ||||
-rw-r--r-- | tests/SkResourceCacheTest.cpp | 18 |
3 files changed, 13 insertions, 13 deletions
diff --git a/tests/MipMapTest.cpp b/tests/MipMapTest.cpp index 4bcbb69697..7e0a653c1e 100644 --- a/tests/MipMapTest.cpp +++ b/tests/MipMapTest.cpp @@ -23,7 +23,7 @@ DEF_TEST(MipMap, reporter) { int width = 1 + rand.nextU() % 1000; int height = 1 + rand.nextU() % 1000; make_bitmap(&bm, width, height); - sk_sp<SkMipMap> mm(SkMipMap::Build(bm, SkSourceGammaTreatment::kIgnore, nullptr)); + sk_sp<SkMipMap> mm(SkMipMap::Build(bm, SkDestinationSurfaceColorMode::kLegacy, nullptr)); REPORTER_ASSERT(reporter, mm->countLevels() == SkMipMap::ComputeLevelCount(width, height)); REPORTER_ASSERT(reporter, !mm->extractLevel(SkSize::Make(SK_Scalar1, SK_Scalar1), @@ -60,7 +60,7 @@ static void test_mipmap_generation(int width, int height, int expectedMipLevelCo SkBitmap bm; bm.allocN32Pixels(width, height); bm.eraseColor(SK_ColorWHITE); - sk_sp<SkMipMap> mm(SkMipMap::Build(bm, SkSourceGammaTreatment::kIgnore, nullptr)); + sk_sp<SkMipMap> mm(SkMipMap::Build(bm, SkDestinationSurfaceColorMode::kLegacy, nullptr)); const int mipLevelCount = mm->countLevels(); REPORTER_ASSERT(reporter, mipLevelCount == expectedMipLevelCount); @@ -90,7 +90,7 @@ DEF_TEST(MipMap_DirectLevelAccess, reporter) { SkBitmap bm; bm.allocN32Pixels(1, 1); bm.eraseColor(SK_ColorWHITE); - sk_sp<SkMipMap> mm(SkMipMap::Build(bm, SkSourceGammaTreatment::kIgnore, nullptr)); + sk_sp<SkMipMap> mm(SkMipMap::Build(bm, SkDestinationSurfaceColorMode::kLegacy, nullptr)); REPORTER_ASSERT(reporter, mm == nullptr); } diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp index 822f67652a..dad958f835 100644 --- a/tests/ResourceCacheTest.cpp +++ b/tests/ResourceCacheTest.cpp @@ -1369,7 +1369,7 @@ static sk_sp<GrTexture> make_mipmap_texture(GrTextureProvider* provider, bm.allocN32Pixels(width, height, true); bm.eraseColor(SK_ColorBLUE); - sk_sp<SkMipMap> mipmaps(SkMipMap::Build(bm, SkSourceGammaTreatment::kIgnore, nullptr)); + sk_sp<SkMipMap> mipmaps(SkMipMap::Build(bm, SkDestinationSurfaceColorMode::kLegacy, nullptr)); SkASSERT(mipmaps); SkASSERT(mipmaps->countLevels() > 1); diff --git a/tests/SkResourceCacheTest.cpp b/tests/SkResourceCacheTest.cpp index 9275dff7d2..c8da135b0d 100644 --- a/tests/SkResourceCacheTest.cpp +++ b/tests/SkResourceCacheTest.cpp @@ -96,17 +96,17 @@ static void test_mipmapcache(skiatest::Reporter* reporter, SkResourceCache* cach src.allocN32Pixels(5, 5); src.setImmutable(); - const SkSourceGammaTreatment treatment = SkSourceGammaTreatment::kIgnore; + const SkDestinationSurfaceColorMode colorMode = SkDestinationSurfaceColorMode::kLegacy; - const SkMipMap* mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), treatment, + const SkMipMap* mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), colorMode, cache); REPORTER_ASSERT(reporter, nullptr == mipmap); - mipmap = SkMipMapCache::AddAndRef(src, treatment, cache); + mipmap = SkMipMapCache::AddAndRef(src, colorMode, cache); REPORTER_ASSERT(reporter, mipmap); { - const SkMipMap* mm = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), treatment, + const SkMipMap* mm = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), colorMode, cache); REPORTER_ASSERT(reporter, mm); REPORTER_ASSERT(reporter, mm == mipmap); @@ -121,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), treatment, cache); + mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src), colorMode, cache); check_data(reporter, mipmap, 2, kInCache, kLocked); cache->purgeAll(); @@ -131,19 +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 SkDestinationSurfaceColorMode colorMode = SkDestinationSurfaceColorMode::kLegacy; 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], treatment, cache)->unref(); + SkMipMapCache::AddAndRef(src[i], colorMode, cache)->unref(); } for (int i = 0; i < N; ++i) { const SkMipMap* mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src[i]), - treatment, cache); + 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. @@ -153,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]), treatment, cache); + mipmap = SkMipMapCache::FindAndRef(SkBitmapCacheDesc::Make(src[i]), colorMode, cache); REPORTER_ASSERT(reporter, !mipmap); } } |