| Index: src/lazy/SkDiscardablePixelRef.cpp
|
| diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
|
| index 73fa4ce84cc2062e29c9dfb67fdd856229f71156..99fe8bfaa94b76c847cb60eed85ebf65ceb33fbe 100644
|
| --- a/src/lazy/SkDiscardablePixelRef.cpp
|
| +++ b/src/lazy/SkDiscardablePixelRef.cpp
|
| @@ -71,6 +71,7 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
|
| SkPMColor colors[256];
|
| int colorCount = 0;
|
|
|
| +#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
|
| const SkImageGenerator::Result result = fGenerator->getPixels(info, pixels, fRowBytes, NULL,
|
| colors, &colorCount);
|
| switch (result) {
|
| @@ -78,11 +79,14 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
|
| case SkImageGenerator::kIncompleteInput:
|
| break;
|
| default:
|
| - fDiscardableMemory->unlock();
|
| - fDiscardableMemoryIsLocked = false;
|
| - SkDELETE(fDiscardableMemory);
|
| - fDiscardableMemory = NULL;
|
| - return false;
|
| +#else
|
| + if (!fGenerator->getPixels(info, pixels, fRowBytes, colors, &colorCount)) {
|
| +#endif
|
| + fDiscardableMemory->unlock();
|
| + fDiscardableMemoryIsLocked = false;
|
| + SkDELETE(fDiscardableMemory);
|
| + fDiscardableMemory = NULL;
|
| + return false;
|
| }
|
|
|
| // Note: our ctable is not purgeable, as it is not stored in the discardablememory block.
|
|
|