From dd1b4e94c4298213f1f238a8634471086d6749fb Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Fri, 24 Mar 2017 22:09:30 +0000 Subject: Revert "simplify api to bitmapcache" This reverts commit 9f4b0ae91e1875831cc11f0629b5db998ad85438. Reason for revert: Nanobench asserts. ../../../src/core/SkBitmapCache.cpp:81: fatal error: "assert(scaledWidth != image->width() || scaledHeight != image->height())" Aborted Command exited with code 134 step returned non-zero exit code: 134 https://chromium-swarm.appspot.com/task?id=351b1d10c7936310&refresh=10 Original change's description: > simplify api to bitmapcache > > Force all Find callers to make a bitmpacachedesc, which now > has more rigid validation. > > Goal is to ensure we never make two desc (which turn into keys) > that look different but represent the same image/transformation. > > BUG=skia: > > Change-Id: I8571837ee4754a69acc99e949bee9a465fa25f2b > Reviewed-on: https://skia-review.googlesource.com/10114 > Commit-Queue: Mike Reed > Reviewed-by: Brian Osman > TBR=brianosman@google.com,fmalita@chromium.org,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Change-Id: I21b3c8a5bae409ba740cfc28b352c3b970dcf5af Reviewed-on: https://skia-review.googlesource.com/10171 Reviewed-by: Florin Malita Commit-Queue: Florin Malita --- src/image/SkImage_Gpu.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/image') diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index b4ec0649f2..66fc813d45 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -63,8 +63,7 @@ SkImageInfo SkImage_Gpu::onImageInfo() const { } bool SkImage_Gpu::getROPixels(SkBitmap* dst, SkColorSpace* dstColorSpace, CachingHint chint) const { - const auto desc = SkBitmapCacheDesc::Make(this); - if (SkBitmapCache::Find(desc, dst)) { + if (SkBitmapCache::Find(this->uniqueID(), dst)) { SkASSERT(dst->getGenerationID() == this->uniqueID()); SkASSERT(dst->isImmutable()); SkASSERT(dst->getPixels()); @@ -87,7 +86,7 @@ bool SkImage_Gpu::getROPixels(SkBitmap* dst, SkColorSpace* dstColorSpace, Cachin dst->pixelRef()->setImmutableWithID(this->uniqueID()); if (kAllow_CachingHint == chint) { - SkBitmapCache::Add(desc, *dst); + SkBitmapCache::Add(this->uniqueID(), *dst); fAddedRasterVersionToCache.store(true); } return true; -- cgit v1.2.3