diff options
author | 2017-03-25 09:51:00 -0400 | |
---|---|---|
committer | 2017-03-25 14:25:58 +0000 | |
commit | 5fa3d6d4b15fd6417de877561f5e4bca422e383c (patch) | |
tree | 2233095e21606cff0781915876dcf0994b4907de /src/image/SkImage_Gpu.cpp | |
parent | 1b52df33927c00d9c5aee63f7239dd77bce15e03 (diff) |
Revert "Revert "simplify api to bitmapcache""
Remove (for now) overly agressive assert
This reverts commit dd1b4e94c4298213f1f238a8634471086d6749fb.
Bug: skia:
Change-Id: Ibdcf0b2e92cf108ae710cd180d4fa359f81176d1
Reviewed-on: https://skia-review.googlesource.com/10129
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/image/SkImage_Gpu.cpp')
-rw-r--r-- | src/image/SkImage_Gpu.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index 66fc813d45..b4ec0649f2 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -63,7 +63,8 @@ SkImageInfo SkImage_Gpu::onImageInfo() const { } bool SkImage_Gpu::getROPixels(SkBitmap* dst, SkColorSpace* dstColorSpace, CachingHint chint) const { - if (SkBitmapCache::Find(this->uniqueID(), dst)) { + const auto desc = SkBitmapCacheDesc::Make(this); + if (SkBitmapCache::Find(desc, dst)) { SkASSERT(dst->getGenerationID() == this->uniqueID()); SkASSERT(dst->isImmutable()); SkASSERT(dst->getPixels()); @@ -86,7 +87,7 @@ bool SkImage_Gpu::getROPixels(SkBitmap* dst, SkColorSpace* dstColorSpace, Cachin dst->pixelRef()->setImmutableWithID(this->uniqueID()); if (kAllow_CachingHint == chint) { - SkBitmapCache::Add(this->uniqueID(), *dst); + SkBitmapCache::Add(desc, *dst); fAddedRasterVersionToCache.store(true); } return true; |