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>
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index c0b5063..339341a 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -401,7 +401,8 @@
}
bool onGetROPixels(SkBitmap* dst) const override {
- if (SkBitmapCache::Find(this->uniqueID(), dst)) {
+ const auto desc = SkBitmapCacheDesc::Make(this->uniqueID(), this->width(), this->height());
+ if (SkBitmapCache::Find(desc, dst)) {
SkASSERT(dst->getGenerationID() == this->uniqueID());
SkASSERT(dst->isImmutable());
SkASSERT(dst->getPixels());
@@ -427,7 +428,7 @@
}
dst->pixelRef()->setImmutableWithID(this->uniqueID());
- SkBitmapCache::Add(this->uniqueID(), *dst);
+ SkBitmapCache::Add(desc, *dst);
fAddedRasterVersionToCache.store(true);
return true;
}