aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-03-24 22:09:30 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-24 22:09:40 +0000
commitdd1b4e94c4298213f1f238a8634471086d6749fb (patch)
tree6da125f682710e984ec99bea88073a465f8c9a9a /src/image
parent51fe9710465d01823f3bd9ad856f6460a98db130 (diff)
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 <reed@google.com> > Reviewed-by: Brian Osman <brianosman@google.com> > 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 <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/image')
-rw-r--r--src/image/SkImage_Gpu.cpp5
1 files changed, 2 insertions, 3 deletions
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;