diff options
Diffstat (limited to 'tests/ImageTest.cpp')
-rw-r--r-- | tests/ImageTest.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index ab2215b17b..ba49000d9a 100644 --- a/tests/ImageTest.cpp +++ b/tests/ImageTest.cpp @@ -411,6 +411,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(c, reporter, ctxInfo) { SkImageInfo info = SkImageInfo::MakeN32(20, 20, kOpaque_SkAlphaType); sk_sp<SkImage> image(create_gpu_image(ctxInfo.grContext())); const uint32_t uniqueID = image->uniqueID(); + const auto desc = SkBitmapCacheDesc::Make(image.get()); auto surface(SkSurface::MakeRaster(info)); @@ -418,13 +419,13 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(c, reporter, ctxInfo) { { SkBitmap cachedBitmap; - REPORTER_ASSERT(reporter, !SkBitmapCache::Find(uniqueID, &cachedBitmap)); + REPORTER_ASSERT(reporter, !SkBitmapCache::Find(desc, &cachedBitmap)); } surface->getCanvas()->drawImage(image, 0, 0); { SkBitmap cachedBitmap; - if (SkBitmapCache::Find(uniqueID, &cachedBitmap)) { + if (SkBitmapCache::Find(desc, &cachedBitmap)) { REPORTER_ASSERT(reporter, cachedBitmap.getGenerationID() == uniqueID); REPORTER_ASSERT(reporter, cachedBitmap.isImmutable()); REPORTER_ASSERT(reporter, cachedBitmap.getPixels()); @@ -438,7 +439,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(c, reporter, ctxInfo) { image.reset(nullptr); { SkBitmap cachedBitmap; - REPORTER_ASSERT(reporter, !SkBitmapCache::Find(uniqueID, &cachedBitmap)); + REPORTER_ASSERT(reporter, !SkBitmapCache::Find(desc, &cachedBitmap)); } } |