Index: src/lazy/SkDiscardablePixelRef.cpp |
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp |
index 73fa4ce84cc2062e29c9dfb67fdd856229f71156..19bfc8ccc798b84cdbb7829b89d6f4dfe04fbd7d 100644 |
--- a/src/lazy/SkDiscardablePixelRef.cpp |
+++ b/src/lazy/SkDiscardablePixelRef.cpp |
@@ -71,18 +71,12 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) { |
SkPMColor colors[256]; |
int colorCount = 0; |
- const SkImageGenerator::Result result = fGenerator->getPixels(info, pixels, fRowBytes, NULL, |
- colors, &colorCount); |
- switch (result) { |
- case SkImageGenerator::kSuccess: |
- case SkImageGenerator::kIncompleteInput: |
- break; |
- default: |
- fDiscardableMemory->unlock(); |
- fDiscardableMemoryIsLocked = false; |
- SkDELETE(fDiscardableMemory); |
- fDiscardableMemory = NULL; |
- return false; |
+ if (!fGenerator->getPixels(info, pixels, fRowBytes, colors, &colorCount)) { |
+ 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. |