diff options
author | Florin Malita <fmalita@chromium.org> | 2017-03-24 22:09:30 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-24 22:09:40 +0000 |
commit | dd1b4e94c4298213f1f238a8634471086d6749fb (patch) | |
tree | 6da125f682710e984ec99bea88073a465f8c9a9a /tests/ImageTest.cpp | |
parent | 51fe9710465d01823f3bd9ad856f6460a98db130 (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 'tests/ImageTest.cpp')
-rw-r--r-- | tests/ImageTest.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index ba49000d9a..ab2215b17b 100644 --- a/tests/ImageTest.cpp +++ b/tests/ImageTest.cpp @@ -411,7 +411,6 @@ 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)); @@ -419,13 +418,13 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(c, reporter, ctxInfo) { { SkBitmap cachedBitmap; - REPORTER_ASSERT(reporter, !SkBitmapCache::Find(desc, &cachedBitmap)); + REPORTER_ASSERT(reporter, !SkBitmapCache::Find(uniqueID, &cachedBitmap)); } surface->getCanvas()->drawImage(image, 0, 0); { SkBitmap cachedBitmap; - if (SkBitmapCache::Find(desc, &cachedBitmap)) { + if (SkBitmapCache::Find(uniqueID, &cachedBitmap)) { REPORTER_ASSERT(reporter, cachedBitmap.getGenerationID() == uniqueID); REPORTER_ASSERT(reporter, cachedBitmap.isImmutable()); REPORTER_ASSERT(reporter, cachedBitmap.getPixels()); @@ -439,7 +438,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(c, reporter, ctxInfo) { image.reset(nullptr); { SkBitmap cachedBitmap; - REPORTER_ASSERT(reporter, !SkBitmapCache::Find(desc, &cachedBitmap)); + REPORTER_ASSERT(reporter, !SkBitmapCache::Find(uniqueID, &cachedBitmap)); } } |